Files
standardnotes-app-web/app/assets/javascripts/directives/functional/elemReady.ts
2021-01-22 11:52:24 +01:00

15 lines
338 B
TypeScript

/* @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() {
const func = $parse(attrs.elemReady);
func($scope);
});
});
}
};
}