OOP way | HTML way |
---|---|
|
|
Dependency injection is a software design pattern in which one or more dependencies are injected, or passed by reference, into a dependent object.
angular.module('myModule', [])
.factory('serviceId', ['depService', function(depService) {
// ...
}])
markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS's HTML compiler ($compile) to attach a specified behavior to that DOM element or even transform the DOM element and its children
{{varible}} // sanitized
{{{variable}}} //safe
ng-app
ng-model
ng-click
ng-href
ng-class
ng-if
ng-repeat
{{ expression | filter }}
{{#each items}}
- {{agree_button}}
{{/each}}
<button {{action 'showMore'}}>Show More...
Controller:
actions: {
expand: function() {
...code...
}
}
{{navigation-bar}}
navigation-bar.js
App.NavigationBarComponent = Ember.Component.extend({
classNames: ['primary']
});