Salesforce + AngularJS + Bootstrap
也可以分成三步:
1. 添加css和js引用:
<apex:stylesheet value="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"></apex:stylesheet>
<script src="https://code.angularjs.org/1.4.9/angular.min.js"></script>
<script src="{!$Resource.forcetk4ng}"></script>
2. 添加html代码:
<div ng-app="ngapp">
<div ng-controller="positionCtl">
<button ng-click="getPositions()" class='btn btn-primary'>Retrieve Data</button>
<table class='table table-bordered table-hover table-striped '>
<thead>
<tr>
<td>Id</td>
<td>Name</td>
<td>IsAllow</td>
</tr>
</thead>
<tbody>
<tr ng-repeat="record in position.records">
<td>{{record.Id}}</td>
<td>{{record.Name}}</td>
<td>{{record.IsAllow__c}}</td>
</tr>
</tbody>
</table>
</div>
</div>
3. 添加js代码,使用forcetk4ng获取数据:
angular.module('ngapp', ['forcetk4ng'])
.controller('positionCtl', function($scope, force){
force.setAccessToken('{!$Api.Session_ID}');
$scope.position = {};
$scope.getPositions = function(){
var soql = "select Id, Name, IsAllow__c from PositionTest__c";
force.query(soql)
.then(
function(records){
$scope.position.records = records;
},
function(event){
console.log(event);
}
);
};
$scope.getPositions();
});
示例: https://c.ap1.visual.force.com/apex/TestApexPage (此地址为个人测试地址)
注:可以给apex:page添加一些属性,去掉Salesforce样式和菜单,就和普通html页面一样了。
<apex:page standardStylesheets="false" showHeader="false" applyHtmlTag="false" applyBodyTag="false" docType="html-5.0">
Salesforce + AngularJS + Bootstrap的更多相关文章
- AngularJS Bootstrap
AngularJS 的首选样式表是 Bootstrap. 可以在 AngularJS 应用中加入 Twitter Bootstrap,你可以在你的 <head>元素中添加如下代码: < ...
- Play1+angularjs+bootstrap ++ (idea + livereload)
我的web开发最强组合:Play1+angularjs+bootstrap ++ (idea + livereload) 时间 2012-12-26 20:57:26 Freewind.me原文 ...
- AngularJS -- Bootstrap(启动器)(转载)
AngularJS -- Bootstrap(启动器) 点击查看AngularJS系列目录 转载请注明出处:http://www.cnblogs.com/leosx/ Bootstrap(初始化) ...
- AngularJS进阶(六)AngularJS+BootStrap实现弹出对话框
AngularJS+BootStrap实现弹出对话框 参考资料: http://angular-ui.github.io/bootstrap/#/modal https://www.zybuluo.c ...
- 【17】AngularJS Bootstrap
AngularJS Bootstrap AngularJS 的首选样式表是 Twitter Bootstrap, Twitter Bootstrap 是目前最受欢迎的前端框架. Bootstrap 你 ...
- 前端MVC学习总结(四)——NodeJS+MongoDB+AngularJS+Bootstrap书店示例
这章的目的是为了把前面所学习的内容整合一下,这个示例完成一个简单图书管理模块,因为中间需要使用到Bootstrap这里先介绍Bootstrap. 示例名称:天狗书店 功能:完成前后端分离的图书管理功能 ...
- AngularJs+bootstrap搭载前台框架——准备工作
1.关于什么是AngularJs以及什么是bootstrap我就不多说了,简单说下,AngularJs是一个比较强大前台MVC框架,bootstrap是Twitter推出的一个用于前端开发的开源工具包 ...
- 前端MVC学习笔记(四)——NodeJS+MongoDB+AngularJS+Bootstrap书店示例
这章的目的是为了把前面所学习的内容整合一下,这个示例完成一个简单图书管理模块,因为中间需要使用到Bootstrap这里先介绍Bootstrap. 示例名称:天狗书店 功能:完成前后端分离的图书管理功能 ...
- AngularJS -- Bootstrap(启动器)
点击查看AngularJS系列目录 转载请注明出处:http://www.cnblogs.com/leosx/ Bootstrap(初始化) 这章介绍了Angular的初始化过程,以及如何在必要的时候 ...
随机推荐
- Java-计划存储
Hive:Hive文档 Hdfs官方 Spark官方 About云中文论坛 书单:2015豆瓣书单 豆瓣千人8.0+书单 编程入口:Eclipse servlet java8 快捷键整理 MyBat ...
- C# mvc DropDownList选中状态无效情况分析
情况: DropDownList控件使用List<SelectListItem>()设置下拉选项和默认值.当控件的Name和后台的ViewBag(或ViewData)的Key重复,会导致选 ...
- string&&char 小技巧
关于string =,assign() //赋以新值 swap() //交换两个字符串的内容 +=,append(),push_back() //在尾部添加字符 insert() //插入字符 ...
- Ajax提交与传统表单提交的区别说明
Ajax提交是通过js来提交请求,请求与响应均由js引擎来处理,页面不会刷新,用户感觉不到实际上浏览器发出了请求.比如说我们希望网页总是显示最新的新闻,而又不想老是去点刷新按钮,我们就可以用Ajax机 ...
- listbox 报错 Cannot have multiple items selected when the SelectionMode is Single.
1.错误提示:Cannot have multiple items selected when the SelectionMode is Single. 刚刚在处理两个Listbox时,将其中一个li ...
- PoEdu - C++阶段班【Po学校】- 第3天
引用 C中指针的功能强大,使用起来繁杂,因为指针要控制的东西太多:有指针的类型,指针的解引用,指针空间内的值,它本身是有空间的,有自己的地址等.指针也是强大的,比如:我们要在函数之内,修改方法之外的值 ...
- window常用命令
netstat -ano|findstr "端口号" :查看指定端口信息[netstat -ano|findstr "端口号" ] ,然后看下PID号 ...
- wpf 空白汉字占位符
<TextBlock xml:space="preserve" Text="主 编" /> 表示一个汉字占位符
- C语言之数组,字符串,指针
一. 数组的定义 1. 数组初始化 初始化方式 int a[3] = {10, 9, 6}; int a[3] = {10,9}; int a[] = {11, 7, 6}; int a[4] = ...
- 使用my exclipse对数据库进行操作(4)
四.删除 public class class4 { public static void main(String[] args) { // TODO Auto-generated method st ...