Refactors most controllers and directives into classes for more organized and maintainable code
This commit is contained in:
14
app/assets/javascripts/directives/functional/elemReady.js
Normal file
14
app/assets/javascripts/directives/functional/elemReady.js
Normal file
@@ -0,0 +1,14 @@
|
||||
/* @ngInject */
|
||||
export function elemReady($parse) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function($scope, elem, attrs) {
|
||||
elem.ready(function() {
|
||||
$scope.$apply(function() {
|
||||
var func = $parse(attrs.elemReady);
|
||||
func($scope);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user