之前虽然一直都在用这套框架,但是对于指令还是知之甚少,感觉是蛮复杂的东西。看了之后也没有真正理解。
最近在做一个Angular的小项目,卡在了Angular的生命周期和自定义指令上。纠结了好几天,终于今天在地铁上灵光一闪想通了。所以赶紧把它记下来,免得后面忘记了。
我们一直都说angular的加载流程是先载入HTML片段,其中在加载标签的时候加载了所有的JS库,包括我们自己写的所有的...
分类:
其他好文 时间:
2015-05-08 10:55:22
阅读次数:
105
本文转自:http://www.codeproject.com/Tips/829025/How-to-Create-Custom-Filters-in-AngularJsIntroductionFilter in Angular JS is a way that will help you to r...
分类:
Web程序 时间:
2015-05-08 10:47:39
阅读次数:
151
单个参数调用angular.module(),用来取得该模块而不是定义新的这样就可以在不同的地方定义app的controller而不用通过全局变量angular.module('myapp').controller('xxController',function(){});在controller中的...
分类:
Web程序 时间:
2015-05-08 09:23:14
阅读次数:
130
angular-formly provides a very simple API to dynamically change properties of your field (like disabled, hidden, and required) using the powerful expr...
分类:
Web程序 时间:
2015-05-07 06:27:51
阅读次数:
445
谈require选项之前,应该先说说controller选项,controller选项允许指令对其他指令提供一个类似接口的功能,只要别的指令(甚至是自己)有需要,就可以获取该controller,将其作为一个对象,并取得其中...
分类:
其他好文 时间:
2015-05-06 23:11:30
阅读次数:
440
I. 分页思想:先将取出来的数据(数组)按照每页多少条数据分割成 数据/每页数 个小数组:此处为每页var pages=5;条,分成 6 页,数据长度为30JS代码: 1 /** 2 3 * Created by LovellY on 2015/4/1. 4 5 */ 6 7...
分类:
其他好文 时间:
2015-05-05 12:30:16
阅读次数:
89
var app = angular.module('manager', ['ngRoute']);app.config(['$routeProvider', function($routeProvider) { $routeProvider .when("/index", { ...
分类:
Web程序 时间:
2015-05-05 10:31:23
阅读次数:
206
Protractor是为Angular JS应用量身打造的端到端测试框架。它可以真实的驱动浏览器,自动完成对web应用的测试。Protractor驱动浏览器使用的是WebDriver标准,所以使用起来与其他语言实现的WebDriver库大体相同。当然,我说大体相同那肯定还是有不同的地方。一旦不注意这...
分类:
其他好文 时间:
2015-05-04 19:53:18
阅读次数:
1591
superman weight 解释: directive 中的controller放一些公共部分 require : 通过require让多个指令共享controller中的数据 ^ 允许从父类开始查找 require:"^superman" ? 如果找不到不抛出异常scope : {} 创建独....
分类:
其他好文 时间:
2015-05-04 17:21:17
阅读次数:
149
1.创建指令的4种方式(ECMA)var appModule = angular.module('app', []);appModule.directive('hello', function(){ return { /** * E 元素 * C ...
分类:
Web程序 时间:
2015-05-04 13:35:17
阅读次数:
160