摘要: <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 猪阿南 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 在模块定义中 [] 参数用于定义模块的依赖关系。中括号[]表示该模块没有依赖,如果有依赖的话会在中括号写上依赖的模块名字。 JavaScript 中应避免使用全局函数。因为他们很容易被其他脚本文件覆盖。 AngularJS 模块让所有函数的作用域在该模块下,避免了该问题。 对于 HTML 应用程序, 阅读全文
posted @ 2017-07-08 21:03 猪阿南 阅读(110) 评论(0) 推荐(0) 编辑
摘要: 除了 AngularJS 内置的指令外,我们还可以创建自定义指令。 你可以使用 .directive 函数来添加自定义的指令。 要调用自定义指令,HTML 元素上需要添加自定义指令名。 使用驼峰法来命名一个指令, runoobDirective, 但在使用它时需要以 - 分割, runoob-dir 阅读全文
posted @ 2017-07-08 20:42 猪阿南 阅读(86) 评论(0) 推荐(0) 编辑
摘要: ng-click 指令定义了 AngularJS 点击事件。<button ng-click="count = count + 1">点我!</button> 当然还有函数 阅读全文
posted @ 2017-07-08 20:28 猪阿南 阅读(61) 评论(0) 推荐(0) 编辑
摘要: ng-disable 将数据绑定到h5元素的disable属性 比如: <div ng-app="" ng-init="mySwitch=true"><p><button ng-disabled="mySwitch">点我!</button></p><p><input type="checkbox" 阅读全文
posted @ 2017-07-08 20:05 猪阿南 阅读(148) 评论(0) 推荐(0) 编辑
摘要: <head><meta charset="utf-8"><script src="https://cdn.bootcss.com/angular.js/1.6.3/angular.min.js"></script><style>table, th , td { border: 1px solid g 阅读全文
posted @ 2017-07-08 19:48 猪阿南 阅读(319) 评论(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 猪阿南 阅读(545) 评论(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 猪阿南 阅读(76) 评论(0) 推荐(0) 编辑
摘要: 有关angular service初步学习笔记:首先,要把service对象作为参数传给controller var app = angular.module('myApp', []);app.controller('customersCtrl', function($scope, $locatio 阅读全文
posted @ 2017-07-07 08:50 猪阿南 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 看完web前端,才发现,web前端不仅仅是怎么显示一个好看的界面。慢慢的,也许就不需要web后端,在未来,微信小程序,web app满大街跑的时候 阅读全文
posted @ 2017-06-29 00:39 猪阿南 阅读(94) 评论(0) 推荐(0) 编辑