惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Attack and Defense Labs
Attack and Defense Labs
T
Threatpost
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
I
Intezer
C
Cyber Attacks, Cyber Crime and Cyber Security
The Register - Security
The Register - Security
量子位
Security Latest
Security Latest
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
大猫的无限游戏
大猫的无限游戏
小众软件
小众软件
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
C
CXSECURITY Database RSS Feed - CXSecurity.com
MyScale Blog
MyScale Blog
J
Java Code Geeks
Apple Machine Learning Research
Apple Machine Learning Research
Google DeepMind News
Google DeepMind News
WordPress大学
WordPress大学
Spread Privacy
Spread Privacy
Jina AI
Jina AI
博客园 - 【当耐特】
P
Palo Alto Networks Blog
Last Week in AI
Last Week in AI
SecWiki News
SecWiki News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
G
GRAHAM CLULEY
宝玉的分享
宝玉的分享
Hacker News - Newest:
Hacker News - Newest: "LLM"
T
The Blog of Author Tim Ferriss
V
Vulnerabilities – Threatpost
有赞技术团队
有赞技术团队
T
Tor Project blog
H
Hacker News: Front Page
A
Arctic Wolf
NISL@THU
NISL@THU
A
About on SuperTechFans
云风的 BLOG
云风的 BLOG
Engineering at Meta
Engineering at Meta
V
V2EX
N
News and Events Feed by Topic
Webroot Blog
Webroot Blog
Know Your Adversary
Know Your Adversary
P
Privacy International News Feed
I
InfoQ
D
Docker
L
LINUX DO - 最新话题
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
U
Unit 42

博客园 - 瑞雪年

开始使用 Xamarin.Forms.Platform.Avalonia Git仓库迁移命令 .NET Core也可以使用MongoDB了 ng2-timesheet, 一个timesheet.js的angular2复制版 Angular 2 + Electron 开发web和桌面应用 Xamarin.Forms.Platform.Perspex, Xamarin Forms 的 Perspex(号称下一代WPF) 实现 Visual Studio Xamarin编译Android项目出错的解决办法 NativeScript 也能开发桌面应用 (nativescript-dotnet-runtime) iOS集成丁香园DXY OAuth 登陆 swift代码示例 WinObjC?这是什么鬼? 如何禁用Marlin温度保护 React Native也正式发布了 微信企业号 用javascript写Android和iOS naitve应用,实在炫酷。 CoreCLR 在 Linux 下编译成功 Swift 对比学习 (二) Swift 对比学习 (一) 重量级Orchard模块发布 - 模块生成工具RaisingStudio.ModuleGenerator coding.net
Salesforce + AngularJS + Bootstrap
瑞雪年 · 2016-01-30 · via 博客园 - 瑞雪年

也可以分成三步:

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">