All Questions
Tagged with angularjs-controlleras angularjs-scope
27 questions
0
votes
1
answer
40
views
AngularJS scope variable value change not reflecting across controllers
In my angularjs, i have two controllers and use the variable which is referred in UI. From UI I am calling method OpenPage of NumTwoController which updates value of variable1 and NumOneController ...
1
vote
0
answers
27
views
AngularJS scope is passed to directive after directive's factory function exits [duplicate]
I'm trying to upgrade an AngularJS template we're using to its latest version.
Now, this template upgraded to AngularJS 1.6.9.
But now, after i've upgraded, i'm experiencing a problem that the vm ...
0
votes
1
answer
171
views
controller as syntax not working with angular 1.4.5 var vm = this template not showing
I had switched to controller as syntax with angular 1.5 -1.6 projects etc...
The particular project I am need to add some functionality to a angular 1.4.5 project.
Usually I using angular routing ...
0
votes
1
answer
143
views
AngularJS 1 injecting $scope inline in one controller breaks second controller
I am trying to improve on the W3Cschools "get something output" syntax for coding AngularJS controllers by following the community driven style guide on Github
As advised, I want to
Avoid use of $...
1
vote
1
answer
34
views
Refactor AngularJS to use controllerAs, apply CSS for a required input once it is not empty
What would be the most efficient way of conditionally changing the background color for a required input once it is valid using AngularJS 1.5.6? Per my understanding and what I have read online, I ...
1
vote
1
answer
414
views
angular directive with controllerAs dosn't work
I'm struggling with making angular directive work with controllerAs. When using $scope everything work as expected but when get rid of $scope directive controller doesn't work. Please see the code ...
1
vote
0
answers
78
views
Angular controllerAs and dirty checking
When using the controllerAs syntax in AngularJS, the controller is added into the scope.
But is it excluded when dirty checking is performed ?
Potentialy, something changed in the controller but has ...
1
vote
1
answer
96
views
Accessing controller from compile function in directives
I have searched all over and the only thing I can come up with is that I don't understand something fundamental about how the compile function works.
Here is what I have
angular.module("app", [])
....
1
vote
2
answers
604
views
AngularJS - Data is not populating in table while using http service
I have a Web API which retrieves list of employees. Now when I call to $http service, I can get data from WebApi but it neither populated in table nor gives any error.
Note: I am using angular v1.5....
0
votes
2
answers
196
views
Have a dynamic html element using AngularJS Directive WHITOUT $scope?
I want to use This Plunker sample code to add some elements dynamically to HTML page using AngularJS. (You should run It in a new link, not in editor environment) This is my first experience in ...
3
votes
2
answers
320
views
Calling sub function in ControllerAs AngularJS
Hey I am new to angularjs Im using controlleras style in angularjs as the code is presentable and net. My problem is calling subfunction in controller my code as follow
//AngularJS CODE
(...
4
votes
1
answer
4k
views
Angular - Directive with controllerAs, bindToController, and $scope.$watch
I have a fairly straightforward AngularJS question to which I cannot seem to find an answer:
How would I go about using $scope.$watch() in a directive controller while also using the controllerAs and ...
0
votes
1
answer
729
views
Pass $scope data from controller to view
I want to display $scope.predicate and $scope.reverse values into my view(in the <p> tag ). It seems that using {{ }} expression is not working.
app.js:
var app = angular.module('testApp', [])...
1
vote
3
answers
110
views
Is there really no difference between AngularJS $scope and Controller as syntax?
I am learning angularJS and while learning found the controller as syntax much easier to read and a little easier for me coming from the OO world to understand. I have read several articles and SO ...
0
votes
1
answer
40
views
Angular controller functions are both constructors and a decorators?
If one writes a controller as ctrl for the following code:
function Controller($scope) {
$scope.abc = "123";
}
angularApp.controller("controller", Controller);
Does the pseudo code below ...