Tagged Questions
0
votes
1answer
17 views
AngularJS referencing parent controller
I am trying to implement the following behavior. I am including a template using ng-inculde where I am doing something like this: {{something}}
I want that 'something' to have double binding with ...
0
votes
0answers
19 views
Temporarily suspend data-binding in AngularJS to update model without firing $scope.$watch
I've gotten myself into trouble with AngularJS databinding in which my different inputs need to be reciprocally bound to each other.
The form needs to contain the following:
A start date (this is a ...
0
votes
1answer
34 views
AngularJs Scope, variable value get changed
I am totally new to AngularJs, i have taken tutorials, I had been stuck from last 5 hours on following problem,
I am using twitterbootstrap and by modal i meant bootstrap modal
It show me the modal ...
0
votes
1answer
35 views
AngularJS: Multiple views with routing without losing scope
I'm trying to implement a classic list/details UI. When clicking an item in the list, I want to display an edit form for that item while still displaying the list. I'm trying to work around Angular's ...
1
vote
0answers
38 views
Where should I put AngularJS scope $watchers?
I'm trying to get changes to an AngularJS scope to trigger actions in a model. To do this I use $scope.$watch() in my item controller, and plug those controllers into directives. The problem I'm ...
0
votes
1answer
37 views
Angular: call service once multiple controllers
This should be a fairly straight forward question, but I'm stumped.
I have a service that makes an http call and then does extensive post-processing of the results. I would like the processed ...
0
votes
1answer
53 views
Angular.js view doesn't update when nested $scope array is updated
I am trying to make an angular.js view update itself when adding a comment. My code is as follows:
<div class="comment clearfix" data-ng-repeat="comment in currentItem.comments" ...
2
votes
1answer
36 views
How can I change the scope of my element from an attribute directive?
<input type='text' ng-model='foo' my-dir='customFunction' />
{{foo}}
.directive('myDir',function(){
scope:{ customFunc : "&myDir"},
});
Now the scope will be overridden with myDir ...
0
votes
1answer
49 views
All variables in $scope undefined in Angular.js
I have a very simple website which uses Angular.js to display its content. I started learning it 2 days ago, and following the official tutorial gave no issues at all.
This is my js file:
var Site = ...
1
vote
1answer
40 views
AngularJS - resource - doas a request have to be inside $scope.$apply?
I could not find anything in the docs about this, but it seems that any request has to be inside a $apply() call - (wether this $apply() call comes from an action or is invoked manually).
I can not ...
0
votes
1answer
92 views
Angular.js best way to pass variable from controller to directive's isolated scope without adding it to parents scope
Sorry if the title is not the most accurate..
So what I'm trying to do and what are my reasons behind it. I have a list of entries which can be pretty huge, up to 400 items, I get this list from ajax ...
0
votes
2answers
52 views
angular built-in directive is not working after custom checkbox directive (with isolate scope) added
I am trying to create a custom checkbox directive in Angular, and I have managed to do so. but the problem is that the build-in ng-click is not called. if the custom directive is removed, the ng-click ...
0
votes
1answer
53 views
Angular - ngModel not updating when called inside ngInclude
First and foremost, the plunker: http://plnkr.co/edit/v1uTz5
This is a working demo of the issue I am running into.
I have a ng-include to include a partial.
Inside the partial I have an text ...
0
votes
1answer
77 views
AngularJS: Access formController of a form placed inside transcluded directive from parent controller
I've created a simple "modal dialog" directive, which uses transclude. I would like to place a form () inside the "modal dialog" directive. I would expect that formController of a form placed inside ...
0
votes
1answer
27 views
Replace a child node in Angular
I'm manipulating a tree of data. From any given node, I might need to add a child node, which is returned from a RESTful server. The data starts out looking something like this…
[{ "text":"Apples", ...
0
votes
1answer
56 views
Angular.js filters and functions on scope that is changing every second
The problem. I have a table of entries($scope.entries), each row(ng-repeat) with 5 columns, 2 of those columns have custom made filter for various transformations.
Now in the same scope I have ...
0
votes
1answer
30 views
AngularJS - Transclude and access ng-repeat filtered list in a sub-directive,
I would like to tile elements that get in to ng-repeat (set up their css based on the filtered list)
Ideally I would like to use html markup like this:
<ul>
<li ng-repeat="row in ...
1
vote
1answer
95 views
AngularJS The scope for dynamic content through $compile isn't attached to the controller scope
When I generate a new element through a string that has a directive (that's why I need to compile) and that directive generates an association with a variable in the controller scope through "=", the ...
1
vote
1answer
37 views
How can I defer view rendering until some data is loaded from an external source?
My app needs to load some data into the $rootScope from an external source when it initializes. Since the data is from an external source, the time required to load the data is not guaranteed. I want ...
2
votes
1answer
53 views
Can child scope $apply itself without applying parent
Is it possible for a child $scope (isolated or not) to do $scope.$apply without the parrent scope being applied?
There is some expensive computation going on (that is hard to cache) in the parent ...
0
votes
0answers
23 views
copy angular scope variable that is bidirectionally derived from parent without having the copy also be bidirectional
Supppose I have this:
<div class="dostuff" some-obj="parentScopeObj">
sAngular.app.directive('dostuff', ['$compile', function($compile){
return {
restrict : 'C',
scope: { someObj : ...
0
votes
1answer
41 views
objects disappear on angular template recompilation
check out this fiddle: http://jsfiddle.net/z9XK3/6/
<div ng-app="miniapp">
<div ng-controller="Ctrl">
<span ng-bind-html-unsafe="variable"></span>
...
2
votes
1answer
112 views
new scope that inherits from parent within angular directives
suppose I do this:
sAngular.app.directive('dostuff', ['$compile', function($compile){
return {
restrict : 'C',
scope: {
someVar : '='
},
link : function(scope, element, ...
0
votes
2answers
105 views
Angular JS: Handling different UI components from each views repeated using ng-repeat when the view look-feel are same
Apologies for the big Title, I couldn't come up with any thing better. Let me explain the issue I am having.
I have to render three cards where each of them share same look-feel, means each of them ...
2
votes
2answers
50 views
Is it OK to use $$prevSibling to access scope data in a 'transcluded' directive?
My directive setup is as follows:
<div data-directive-a data-value="#33ff33" data-checked="true">
<div data-directive-b></div>
</div>
I'm using transclusion to ensure ...
3
votes
1answer
57 views
How can I check an ng-included form's validity from the parent scope?
I have a subform that is shared among multiple views in my app. In one view, this subform is displayed alone with a back/continue button at the bottom that leads the user to the next subform. In ...
0
votes
1answer
48 views
How to select AngularJS model on first time load?
I'm using AngularJS to populate a select option list.
And I'm selecting an option by default depending on a field isMandatory.
But the problem is I can't get the id of the selected item on first time ...
3
votes
2answers
94 views
Can I avoid the object variable name in ng-repeat loop?
When defining an ng-repeat directive to iterate over an array, the syntax specifies ng-repeat="friend in friends", and then within the template you use the interoplation operator like so ...
0
votes
2answers
55 views
in a directive, $watch fires two times reverting newValue to the original pre $watch firing value
I'm pretty sure I'm doing something wrong because of my little experience with angular.
Probably the answer is already somewhere in stackoverflow, and I'm not asking (googling) the right questions.
...
1
vote
1answer
86 views
Error: No controller: ngModel
When I add ng-change="reverseOrder=this.checked" to a checkbox, as so:
<input id="reverseOrder" type="checkbox" ng-change="reverseOrder=this.checked"/>
I get the following exception:
Error: ...