This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tab-pane" ng-show="tab.details.selected"> | |
<h4>{{tab.details.title}}</h4> | |
<div ng-transclude></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('tabs', function() { | |
return { | |
restrict: 'E', | |
transclude: true, | |
scope: {}, | |
controllerAs: 'tabs', | |
controller: [function TabsController() { | |
var tabs = this; | |
var panes = tabs.panes = [] | |
tabs.select = function(pane) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="tab-pane" ng-show="details.selected"> | |
<h4>{{details.title}}</h4> | |
<div ng-transclude></div> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('tabs', function() { | |
return { | |
restrict: 'E', | |
transclude: true, | |
scope: { }, | |
controller: ['$scope', function TabsController($scope) { | |
var panes = $scope.panes = [] | |
$scope.select = function(pane) { | |
angular.forEach(panes, function(p) { | |
p.selected = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.directive('myDirective', function () { | |
return { | |
restrict: 'AECM', | |
require: 'ngModel', | |
link: function (scope, element, attrs, ctrl) { | |
console.log('ngModelController', ctrl) | |
} | |
} | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ngAfterViewChecked(): void { | |
this.zone.runOutsideAngular(() => { | |
this.el.nativeElement.classList.add('highlight') | |
setTimeout(() => { | |
this.el.nativeElement.classList.remove('highlight') | |
}, 1500) | |
}) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<span> | |
{{title}} | |
</span> | |
<button (click)="title='Changed'"> | |
Change Title | |
</button> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tick(): void { | |
try { | |
this._views.forEach((view) => view.detectChanges()); | |
if (this._enforceNoNewChanges) { | |
this._views.forEach((view) => view.checkNoChanges()); | |
} | |
} catch (e) { | |
... | |
} finally { | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this._zone.onMicrotaskEmpty.subscribe({ | |
next: () => { | |
this._zone.run(() => { | |
this.tick(); | |
}); | |
}} | |
); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myZoneSpec = { | |
beforeTask: function () { | |
console.log('Before task'); | |
}, | |
afterTask: function () { | |
console.log('After task'); | |
} | |
}; | |
var myZone = zone.fork(myZoneSpec); |