-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.txt
91 lines (53 loc) · 2.02 KB
/
script.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
DEMO 0
git checkout tags/demo-0
static list of some lunch spots in Sudbury
DEMO 1
git checkout tags/demo-1
declared our eatApp module; set it as our application module using the data-ng-app directive
created a controller that has the list of restaraunts in it
used data-ng-controller to bind the controller to the div that contains the UI elements it is responsible for
use the data-ng-repeat directive to enumerate the restaraunt names
DEMO 2
git checkout tags/demo-2
Added add/remove functionality
Change to array of places in controller automatically changes those that are displayed
DEMO 3
git checkout tags/demo-3
highlighting most recently added place
Illustrates that can data-bind to an object returned by a function
DEMO 4
git checkout tags/demo-4
Extract rendering of element in UL to <place-entry></place-entry>
'=' sets up two-way data binding between "outside world" and the directive
('@' sets up one-way data binding, '&' executes method on containing scope)
Breaks delete button - time to talk about isolate scope
DEMO 5
git checkout tags/demo-5
execute the removePlace function via "&" link
DEMO 6
git checkout tags/demo-6
refactor into PlacesService, inject into controller
point out that now we don't really need our controller to have an add method; we could do it directly in service.
SERVICES ARE SINGLETONS
DEMO 7
git checkout tags/demo-7
LunchPlacesService injected into place-entry directive
Don't need the remove via '&' link on directive
Don't need the remove method in the controller
DEMO 8
git gheckout tags/demo-8
created last-added-place attribute directive with LunchPlacesService injected
Don't need the has last junk in the controller
DEMO 9
git checkout tags/demo-9
Filter list based on text using built-in filter
DEMO 10
git checkout tags/demo-10
Add filter that appends "mmmm Pizza"
DEMO 11
git checkout tags/demo-11
refactor to use the foursquare service
$resource injection
DEMO 12
git checkout tags/demo-12
refactor service to be minification-compatible