Organized
Familiar-ish
/dəˈrektiv/
noun
an official or authoritative instruction
<% for(var i = 0; i < things.length; i ++;) %>
<li><%= things[i] %></li>
<% end %>
// app.js
var element = document.querySelector('ul');
for (var i = 0; i < things.length; i++) {
var li = document.createElement('li')
var thing = document.createTextNode(things[i])
li.appendChild(thing)
element.appendChild(li)
}
<!-- index.html -->
<ul><ul>
<li ng-repeat='thing in things'> {{thing}} </li>
<div ng-show="3 + 4 == 5">
3 + 4 isn't 5, don't show
</div>
<div ng-hide="3 + 4 == 5">
3 + 4 isn't 5, don't hide
</div>
<div ng-if="3 + 4 == 5">
3 + 4 isn't 5, don't show
</div>
same as ng-show?
clone this repo:
https://github.com/gSchool/angular-builtin-directives-lecture-support
ng-model
ng-init
ng-controller
VIEW
ng-model='fruit'
MODEL
input: 'banana'
{{fruit}} = 'banana'
$scope object
fruit: 'banana'
{{fruit}} = 'banana'
VIEW
CONTROLLER
MODEL
$scope object
ng-model='fruit'
fruit: banana
{{fruit}}
$scope.fruit
ng-controller='myController'
ng-app='myApp'