5 questions
0
votes
2
answers
2k
views
Is "$onInit", more efficient way than "activate" to activate "controller" in angularJS? [closed]
I'm new to angularJS and want to implement the efficient thing for my project but got stuck between $onInit (life cycle hook) and activate().
1
vote
2
answers
2k
views
Error: $rootScope:inprog -- What is the correct way to 'not' execute $apply in angular?
AngularJS Wiki - Anti-Patterns states the following:
Don't do if (!$scope.$$phase) $scope.$apply(), it means your $scope.$apply() isn't high enough in the call stack.
And I kind of understand this. ...
3
votes
2
answers
1k
views
How to put listen over $destroy while using controllerAs syntax in angular
Now I'm getting rid of $scope dependency from my angular controller to ensuring that I could easily migrate my code to Angular2. My current angular version is 1.4.X.
While doing the same thing there ...
3
votes
1
answer
124
views
Lifecycle hook this.$postLink gives typeerror
I'm trying to learn angular 1.5 component and have stumbled into a problem. The following code is my startup layout of my component, which compiles without errors with my gruntjob.
angular.module('...
3
votes
2
answers
2k
views
AngularJS - Accessing ng-init variables from run method
1) I have variables initialized in ng-init
Eg -
ng-init="password='Mightybear'";
2) I want to access it from the .run method.
Eg -
anguar.module("ngApp", [])
.run(function() {
//Access ...