Functional directives TS
This commit is contained in:
14
app/assets/javascripts/directives/functional/elemReady.ts
Normal file
14
app/assets/javascripts/directives/functional/elemReady.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
/* @ngInject */
|
||||
export function elemReady($parse: ng.IParseService) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function($scope: ng.IScope, elem: JQLite, attrs: any) {
|
||||
elem.ready(function() {
|
||||
$scope.$apply(function() {
|
||||
var func = $parse(attrs.elemReady);
|
||||
func($scope);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user