07 2017 档案

摘要:<meta charset="utf-8"><script src="https://cdn.bootcss.com/angular.js/1.4.6/angular.min.js"></script></head><body> <h2>验证实例</h2> <form ng-app="myApp" 阅读全文
posted @ 2017-07-08 21:12 猪阿南 阅读(62) 评论(0) 推荐(0)
摘要:除了 AngularJS 内置的指令外,我们还可以创建自定义指令。 你可以使用 .directive 函数来添加自定义的指令。 要调用自定义指令,HTML 元素上需要添加自定义指令名。 使用驼峰法来命名一个指令, runoobDirective, 但在使用它时需要以 - 分割, runoob-dir 阅读全文
posted @ 2017-07-08 20:42 猪阿南 阅读(91) 评论(0) 推荐(0)
摘要:ng-click 指令定义了 AngularJS 点击事件。<button ng-click="count = count + 1">点我!</button> 当然还有函数 阅读全文
posted @ 2017-07-08 20:28 猪阿南 阅读(68) 评论(0) 推荐(0)
摘要:ng-init 设置默认选中值。<div ng-app="myApp" ng-controller="myCtrl"> <select ng-init="selectedName = names[0]" ng-model="selectedName" ng-options="x for x in n 阅读全文
posted @ 2017-07-08 19:26 猪阿南 阅读(556) 评论(0) 推荐(0)
摘要:1.5以下的版本 <script>var app = angular.module('myApp', []);app.controller('siteCtrl', function($scope, $http) { $http.get("http://www.runoob.com/try/angul 阅读全文
posted @ 2017-07-07 17:34 猪阿南 阅读(81) 评论(0) 推荐(0)
摘要:有关angular service初步学习笔记:首先,要把service对象作为参数传给controller var app = angular.module('myApp', []);app.controller('customersCtrl', function($scope, $locatio 阅读全文
posted @ 2017-07-07 08:50 猪阿南 阅读(85) 评论(0) 推荐(0)