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

推荐订阅源

V
Visual Studio Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
宝玉的分享
宝玉的分享
The Register - Security
The Register - Security
D
Docker
The Cloudflare Blog
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Recent Announcements
Recent Announcements
月光博客
月光博客
B
Blog RSS Feed
博客园 - 【当耐特】
The GitHub Blog
The GitHub Blog
B
Blog
IT之家
IT之家
美团技术团队
Engineering at Meta
Engineering at Meta
C
Check Point Blog
云风的 BLOG
云风的 BLOG
Last Week in AI
Last Week in AI
G
Google Developers Blog
MongoDB | Blog
MongoDB | Blog
Microsoft Azure Blog
Microsoft Azure Blog
S
SegmentFault 最新的问题
V
V2EX
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Apple Machine Learning Research
Apple Machine Learning Research
U
Unit 42
H
Help Net Security
雷峰网
雷峰网
人人都是产品经理
人人都是产品经理
博客园 - 司徒正美
Stack Overflow Blog
Stack Overflow Blog
博客园 - Franky
PCI Perspectives
PCI Perspectives
J
Java Code Geeks
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
M
MIT News - Artificial intelligence
腾讯CDC
A
Arctic Wolf
C
CERT Recently Published Vulnerability Notes
量子位
C
CXSECURITY Database RSS Feed - CXSecurity.com
Latest news
Latest news
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
The Hacker News
The Hacker News
有赞技术团队
有赞技术团队
Schneier on Security
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻

博客园 - Adam.Zhao

简单示例理解神闭包 ejs 模板使用方法 我使用的开源组件汇总,以备学习使用 了不起的Node.js--之五 TCP连接 Windows7下Java运行时环境搭建 了不起的Node.js--之四 了不起的Node.js--之三 了不起的Node.js--之二 了不起的Node.js--之一 请大家有需要购物的到我的网站上吧。 AngularJS应用骨架 好久没有来写博客了 c#二进制文件数据转换base64字符串文本代码 ActionFilterAttribute做切面编程的Url的格式化例子 学习content-type 网站性能优化之服务端(一) 艺龙旅行网招聘了 关于项目管理的几点建议 HP CQ35 Windows7声卡驱动安装不上问题
最近在研究google的angularjs
Adam.Zhao · 2013-12-05 · via 博客园 - Adam.Zhao

 最近在研究google的angularjs,先做个简单的例子来试试。

<!doctype html>
<html lang="en" ng-app="myApp">
<head>
    <meta charset="utf-8">
    <title>parent demo</title>
    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="scripts/libs/angular.min.js"></script>
</head>
<body>

<div ng-controller="TextController"><p ng-bind="someText.message"></p></div>

<div class="selected"><div><p class="ag">Hello Again</p></div></div>

<form ng-controller="SomeController">
    <input type="checkbox" ng-model="youCheckedIt" />
    <input type="button" ng-click="checkedIt()" value="Click" />
</form>
<script>
    var myAppModule=angular.module('myApp', []);
    myAppModule.controller('TextController', function($scope){
       var someText = {};
        someText.message = 'You have started your journey.';
        $scope.someText = someText;
    });

    myAppModule.controller('SomeController', function($scope){
        $scope.youCheckedIt=true;
        $scope.checkedIt = function(){
            alert($scope.youCheckedIt);
            $scope.youCheckedIt=false;
        };
    });
</script>

<script>
    console.log($( "p.ag" ).parents("div").length);
    $( "p.ag" ).parents("div").css( "background", "yellow" );
</script>


</body>
</html>