$ whoami
<input ng-model="data.name">
<p>Hello {{data.name}}!</p>
app.controller('MyCtrl', function($scope) { $scope.data = {name: 'Mark'}; });
$rootScope.$apply()
-> $childScope
-> $childScope
-> $childScope
<page> <tabs> <tab title="View"> <calendar></calendar> <select2 opts="config.select2.countries"></select2> // ... </tab> <tab title="Settings"> // ... </tab> </tabs> </page>
Angular | ~13K |
Backbone | ~16K |
Ember | ~8K |
Knockout | ~4K |
app.directive('MyCalendar', function() { return { restrict: 'A', link: function (scope, elem, attrs) { // ... elem.attachMyJQueryCalendar(); scope.$on('$destroy', function() { elem.detachMyJQueryCalendar(); }); } } });