-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
53 lines (46 loc) · 1021 Bytes
/
notes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
Attribute Widget:
ng:repeat
Directives:
ng:init
ng:bind
ng:app
ng:model
ng:controller
ng:repeat
ng:include
ng:click
$watch
$apply
$digest
$rootScope
$new
$http
$defer
$destroy
directives
controllers
scope
widgets
<div ng:init="u='http://zzz.net/photo.jpg'; n='zen'">
<cb:picture url="u" name="n"></cb:picture>
</div>
angular.widget('cb:picture', function(compileElement){
var compiler = this;
compileElement.css('display', 'block');
var urlExp = compileElement.attr('url');
var nameExp = compileElement.attr('name');
return function(linkElement){
var salutationSpan = angular.element('<span class="salutation"></span');
var nameSpan = angular.element('<span class="name"></span>');
linkElement.append(salutationSpan);
linkElement.append(' ');
linkElement.append(nameSpan);
linkElement.append('!');
this.$watch(salutationExp, function(value){
salutationSpan.text(value);
});
this.$watch(nameExp, function(value){
nameSpan.text(value);
});
};
});