也可以分成三步:

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的更多相关文章

  1. AngularJS Bootstrap

    AngularJS 的首选样式表是 Bootstrap. 可以在 AngularJS 应用中加入 Twitter Bootstrap,你可以在你的 <head>元素中添加如下代码: < ...

  2. Play1+angularjs+bootstrap ++ (idea + livereload)

    我的web开发最强组合:Play1+angularjs+bootstrap ++ (idea + livereload) 时间 2012-12-26 20:57:26  Freewind.me原文   ...

  3. AngularJS -- Bootstrap(启动器)(转载)

    AngularJS -- Bootstrap(启动器)   点击查看AngularJS系列目录 转载请注明出处:http://www.cnblogs.com/leosx/ Bootstrap(初始化) ...

  4. AngularJS进阶(六)AngularJS+BootStrap实现弹出对话框

    AngularJS+BootStrap实现弹出对话框 参考资料: http://angular-ui.github.io/bootstrap/#/modal https://www.zybuluo.c ...

  5. 【17】AngularJS Bootstrap

    AngularJS Bootstrap AngularJS 的首选样式表是 Twitter Bootstrap, Twitter Bootstrap 是目前最受欢迎的前端框架. Bootstrap 你 ...

  6. 前端MVC学习总结(四)——NodeJS+MongoDB+AngularJS+Bootstrap书店示例

    这章的目的是为了把前面所学习的内容整合一下,这个示例完成一个简单图书管理模块,因为中间需要使用到Bootstrap这里先介绍Bootstrap. 示例名称:天狗书店 功能:完成前后端分离的图书管理功能 ...

  7. AngularJs+bootstrap搭载前台框架——准备工作

    1.关于什么是AngularJs以及什么是bootstrap我就不多说了,简单说下,AngularJs是一个比较强大前台MVC框架,bootstrap是Twitter推出的一个用于前端开发的开源工具包 ...

  8. 前端MVC学习笔记(四)——NodeJS+MongoDB+AngularJS+Bootstrap书店示例

    这章的目的是为了把前面所学习的内容整合一下,这个示例完成一个简单图书管理模块,因为中间需要使用到Bootstrap这里先介绍Bootstrap. 示例名称:天狗书店 功能:完成前后端分离的图书管理功能 ...

  9. AngularJS -- Bootstrap(启动器)

    点击查看AngularJS系列目录 转载请注明出处:http://www.cnblogs.com/leosx/ Bootstrap(初始化) 这章介绍了Angular的初始化过程,以及如何在必要的时候 ...

随机推荐

  1. Codeforces 734E. Anton and Tree 搜索

    E. Anton and Tree time limit per test: 3 seconds memory limit per test :256 megabytes input:standard ...

  2. 哈哈,修改PHP5.4.44语法成功

    作为一个脚本语言,面向对象的继承基本上不想用到,强类型比较也想使用==直接比较.作为专业程序员不想让PHP解释器代劳过多. 修改了这个MOD版本,效果杠杠的.

  3. XE3随笔16:将字符串转换成 UTF8 编码的函数

    这种转换一般用于网页地址; 我不知道 Delphi 是不是有现成的函数, 用到了就写了一个. //函数: function ToUTF8Encode(str: string): string; var ...

  4. SQL Server 常用函数

    1.DATEADD 在向指定日期加上一段时间的基础上,返回新的 datetime 值. 语法 DATEADD ( datepart , number, date ) 参数 datepart 是规定应向 ...

  5. Tornado中Cookie过期问题

    首先,web应用程序是使用HTTP协议进行数据传输,因为HTTP协议是无状态的,所以一旦提交数据完成后,客户端和服务器端的连接就会被关闭,再次进行数据的交换就得重新建立新的连接,那么,有个问题就是服务 ...

  6. c#一个泛型控制Textbox 和label 控件 泛型方法。

    class ControlHelper { public static void ShowOnTxtLbl<T>(T control, string mess) where T : Sys ...

  7. javascript父级鼠标移入移出事件中的子集影响父级的处理方法

    一.我们先分析其产生的原因: 1.当鼠标从父级移入子集时触发了父级的两个事件:a.父级的mouseout事件(父级离开到子集):b.由于事件冒泡影响,又触发了父级的mouseover事件(父级移入父级 ...

  8. 编辑器sublime text3和插件package control、Sidebar Enhancements插件安装

    (1)编辑器sublime text3的安装:选择自己需要的版本下载安装:http://www.sublimetext.com/3 (2)package control插件安装:https://pac ...

  9. 深入研究C语言 第三篇

    本篇研究TC2.0下其他几个工具.同时看看TC由源代码到exe程序的过程. 1. 用TCC将下面的程序编为.obj文件 我们知道,TCC在默认的编译连接一个C语言的源程序a.c的时候分为以下两步: ( ...

  10. Linux 忘记root登录密码解决方法

    很多朋友经常会忘记Linux系统的root密码,linux系统忘记root密码的情况该怎么办呢?重新安装系统吗?当然不用!进入单用户模式更改一下root密码即可. 步骤如下: 重启linux系统 3  ...