0
votes
0answers
28 views

Difference between using “this.$scope.x” and “this.x” with ngControllers? [duplicate]

Edit: While the other question & and answer is sufficient, I still don't understand why/how functions added to function's prototype inherit the scope. According to the other answer they shouldn't ...
-1
votes
1answer
23 views

AngularJS scope defined function is null

I have a function defined in my controller that get's bound to an a element with ng-click, the li element in which the a element is nested also has an ng-repeat directive. When I inspect the $scope ...
0
votes
1answer
24 views

passing model value from ng-repeat to ng-include to a directive using “=” in scope fails

i have the following code in my homepage <ul> <li ng-repeat="item in list" ng-bind-html-unsafe="item.Content" ng-include="item.Template" > </li> </ul> the value of ...
-1
votes
1answer
27 views

angular TypeError: Converting circular structure to JSON

Hi I have a small Angular app like so: // html <div ng-repeat="project in projects"> <h3>{{ project.id }}</h3> <h3>{{ project.title }}</h3> <div ...
0
votes
2answers
51 views

How do I access ng-model values inside my directive template?

I have a directive with a template that looks like <!-- selectList.tpl.html --> <div ng-if="selectList"> <p>Id: {{$id}}</p> <p>Current list item ...
1
vote
2answers
21 views

Angular directive: bind to variable in parent scope

Angular directive demo: jsfiddle <div ng-app="myApp"> <script> function Contrl($scope){ $scope.parval = 0; $scope.items = [ {id: 1, text: '1'}, ...
0
votes
1answer
31 views

AngularJs one controller for multiple DOM/scope

Maybe tricky title... For example lets use Google Maps Api v3. I have array of JSON objects with coordinates and information for various cities. What if i want to create ONE controller for all ...
0
votes
2answers
31 views

Angular repeat bind to independent objects

I have a small Angular application which repeats a list of project objects and allows editing each individual object. // app.html <div ng-controller="ProjectsCtrl"> <div ...
0
votes
2answers
41 views

Angular scope doesn't update when removing an item

I have a simple application where I can add users to a list and remove them. The form to add a new user binds to $scope.newPerson. On submitting the form, I add the newPerson object to $scope.people ...
0
votes
1answer
12 views

angular.js Getting the element from inside $evalAsync in directive

I'm finding that I'm using scope.$evalAsync inside a directive quite a lot. Mainly to do DOM stuff/jquery plugins that need all the template {{vars}} compiled. I can get at the scope object from ...
1
vote
0answers
38 views

In Angular JS, can we use ng-controller twice? [on hold]

I' am trying to develop an web application using Angular JS. I' am trying to create two Angular JS controllers in the same page but things seems to be not working. Please can someone tell me where I ...
1
vote
1answer
19 views

How Can I break a retryQueue in angularJS?

What is the purpose of retryQueue and I want to know is there anyway to break retryQueue in angularJS. Please revert asap...
2
votes
2answers
27 views

angularjs - understanding $ mark and services

I've been doing the tutorial from angular page but I don't understand why services (like $scope, $http) have names which begin from $ ?? what this $ mark means in context of angular? If I write own ...
0
votes
0answers
18 views

AngularJS: How to tell if custom directive's scope a child scope of ng-repeat or parent scope?

I have a custom directive that I'm using $parse on the attribute's value, which is an expression for a list to be used to add items to an unordered list. The problem I'm having is in the link ...
0
votes
1answer
39 views

Anular JS controller scope, mulptiple views

For a dashboard type project (one page, multiple smaller views of different models) we are using among other tools the Angular framework. The problem consists of the following: I have a ...
1
vote
1answer
27 views

AngularJS document ready not functioning

I'm trying to add a jQuery listener on a button that is being printed with AngularJS, the listener fails to work since the element is not yet available on DOM: var app = angular.module('myapp', []); ...
0
votes
2answers
30 views

angularjs multiple controllers on one page

I have a page with multiple controllers, one of the controller is being used in 2 different divs within the same page. I am not sure if it is a scope issue or I just miss something in my code. here ...
0
votes
1answer
21 views

How do I update the scope of a service?

Here is my code: angular.module("testApp", []) .service("testService", function() { var privateScope = [1,2,3]; return { getScope: function() { return privateScope; ...
0
votes
1answer
94 views

How do I generate child controllers based on the scope of a parent control?

I am designing an interface that displays a list of panels, each with its own model. I want to be able to render each panel so it has its own model using the model from the parent controller. ...
1
vote
1answer
39 views

Calculate total over repeated cart item totals with angular

I've a simplified shopping cart like the following with a controller for each cart item: <!DOCTYPE HTML> <html ng-app="cart"> <div ng-controller="cartCtrl"> <table> ...
0
votes
1answer
22 views

Call a normal JS function of other file after data from $http is loaded and is binded to the views

I want to call a regular JavaScript function after my webservice call has completed and all the data is binded to the respective views. This JS function is in another file so I cannot access it in my ...
1
vote
1answer
44 views

Problems when testing directives with an isolated scope

It seems that I am unable to obtain a reference to the proper scope when running tests on directives with an isolated scope. Just to be clear I don't have this problem for tests that inherit scope. ...
0
votes
1answer
66 views

angular datepicker bootstrap-ui doesent work in view

I use Bootstrap components written in pure AngularJS by the AngularUI Team http://angular-ui.github.io/bootstrap/ Problem is that inside view datepicker won't work correctly. so in view I have code ...
-1
votes
0answers
23 views

angular $watch does not work and NgModelController has no method '$setPristine'

I try to programming with effort my first angular application that validate form. First of all, i wonna programming custom form validation. Look at the code, only input name field (is writting jade) ...
0
votes
1answer
42 views

Pass more than one arguments to controller function from angular directive

I need to pass two arguments from directive to a function which is defined in controller. HTML <div paginate="allResults" change-page="changePage()"></div> Directive ...
-1
votes
0answers
30 views

Angular - controller “launching” another controller

I have a dashboard with many various "widgets". Each widget consists of Angular controller, some HTML and possibly directives etc. It's structure is as follows: - container - contacts - tasks - ...
0
votes
2answers
32 views

Why is ng-maxlength not re-evaluated?

I have a form, that has one input field and three check boxes. Depending on which check box is selected the max length on the field needs to change. I have a input field defined like this <input ...
1
vote
1answer
31 views

Call controller function from angular directive

How can I call angular function inside directive which is defined in controller? var app = angular.module('myApp', ['ngResource']); app.directive('hello', function () { return { scope: { ...
0
votes
2answers
32 views

Angular directive not showing

I've got a tiny problem with an angular directive that's now working and I don't know why. I think it's a fairly simple issue that I'm overlooking, maybe you can help me out. Directive is defined ...
1
vote
1answer
23 views

Angular Directive - Nested Object in Attr

There is great solution provided for this question, that shows how to use a directive to display <tr>'s for nested objects. However, I need to take it a step further and pass a nested object ...
0
votes
1answer
15 views

Angular - unwanted behavior -new object permanently binds to template element

I have a small Angular project which implements a Controller thusly: concernsApp.factory('ConcernService', function ($http, $q) { var api_url = "http://localhost:8000/api/"; var ConcernService = { ...
0
votes
1answer
20 views

Destroying child directive scope

In my application i've created two directives, one parentDirective and childDirective.The parent directive dynamically creates child directives depending on some criteria defined in parent on button ...
0
votes
1answer
27 views

Why is my function evaluated multiple times?

I am having interesting situation that i am trying to understand. On surface everything works fine, but I had to debug something in a function and noticed that it gets called multiple times (to be ...
0
votes
1answer
34 views

AngularJS - hide a div when clicking in an inner element using a directive

I'm trying to hide a box when clicking on a link inside this box. I wan't to use a directive to be able to add more code when once the box is hiden and to keep it generic so I can use that with other ...
0
votes
2answers
32 views

AngularJs ng-if for displaying or skipping on element

I am using AngularJS. I have the following template: <div> ... html content .... </div> I want to wrap the html content with an anchor only if the url model is not empty. For ...
0
votes
1answer
28 views

Share data between two controllers in angularjs using restangular

I am fairly new to angularjs, so please bear with me. I have two controllers, one of which has a Restangular call to load a certain json object. How do I access this same json object in another ...
0
votes
1answer
11 views

Add/remove indicies in AngularJS model

AngularJS ubern00b here. Here's an angular module that I built: var myApp = angular.module('myApp',[]); myApp.controller('RentalAppCtrl', ['$scope', function($scope) { $scope.master = {}; ...
0
votes
2answers
30 views

Angular wait resource delete respond to update list?

I'm using $resource to add/delete list. The problem is after deletion I still see sometimes deleted element. How I can resolve it? This is the code: services.js var services = ...
0
votes
1answer
15 views

Angular pass parameter from Template to Controller and from Controller to service

I have a code that use Resources to create and list using APIRest, I need pass a Id from template to controller and from controller to service. This is my code: Template.html <div ...
1
vote
0answers
44 views

AngularJS Table dat refresh based on dropdown list value selected

Interesting to read through your AngularJS articles, especially for new learner. Currently I am working on a project which has a senario to select parent list control to populate another dropdown ...
0
votes
1answer
54 views

How to get the form data when the form is in a directive in Angular?

I have this this template: <div class="modal" id="popupModal" tabindex="-1" role="dialog" aria-labelledby="createBuildingLabel" aria-hidden="true"> <div class="modal-dialog"> ...
0
votes
0answers
27 views

How to expand a tree in javascript which is generated using a recursive directive in Angular?

I build a tree using a recursive directive: app.directive('recursiveListItem', ['$http', 'RecursionHelper', function ($http, RecursionHelper) { return { restrict: 'E', scope: { ...
0
votes
1answer
16 views

AngularJs accessing attribute difference, via linking and scope

Can anyone explain whats the difference between accessing directive attribute from the scope as in : scope: { someVar: '=' } vs link: function (scope, elem, attr, ctrl) { attr.someVar } It ...
0
votes
0answers
29 views

How to avoid transparent creation of scope objects

I am learning to use AngularJS and have stumbled upon something, which I view as bad design. I am following the docs about forms and am re-creating the given examples. My code can be viewed here - ...
0
votes
0answers
19 views

In template of the directive i had added the click event which was handling in the link .But the issue is that the function is calling two times

this is my directive .IN this i had added the ng-click for the li with the display of the item name but the function is calling for two times .Any one can you please explain it was happening .below ...
1
vote
4answers
115 views

AngularJS directive gets not updated if scope variable changes

I've tried to write a small directive, to wrap its contents with another template file. This code: <layout name="Default">My cool content</layout> Should have this output: <div ...
0
votes
1answer
30 views

How get Data from AngularJS using a scope with different kinds of Propierties?

I have assigned to an scope object an object (class) but this class has two attributes: two arrays and two strings, how can i get the values from this $scope?? Ex: Object to Assign: var Address ...
0
votes
1answer
48 views

Changing colour of angularjs slider with pointer

Hi I'm building a slider in angularjs that changes color depending on where you move the pointer. 1.) if the pointer is on the rightside, the bar will be red 2.) if the pointer is on the leftside, ...
0
votes
1answer
43 views

Angularjs ui modal windows with timepicker

I am trying to add a timepicker and a datepicker on a modal window and feels like the mytime model doesn't update. You can see it in the alert windows. Can someone give me a hint. When I do a output ...
0
votes
1answer
64 views

Is there any way concatenate the variable name with a string or it is basic programming Mistake

I am working on an AngularJs app. I have an array of HTML select tags where I am concatenating the ng-model name and the options list name with a variable. He re I have two list or arrays. the first ...

15 30 50 per page