In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.

learn more… | top users | synonyms

0
votes
1answer
41 views

Can't access object in $scope

I have this code in services: return { getReport: function(data){ var request = $resource(getResourcePath('report')); return request.get(data, function(...
0
votes
1answer
22 views

2 Object scope colliding with each other

I am doing insert and update with angular js but the problem is when i try to add user and change firstname then that change is reflected in my list of user first name and when i try to add new user ...
0
votes
0answers
16 views

AngularJS Form Builder

I am creating a form builder using angularJS. First off, i'm sorry for the long question and also covering two issues but I was unsure how else to ask it and I am at a dead end. I am new to angular ...
0
votes
1answer
13 views

Angular $http using json file works but using json file with $httpBackend is not working to display data

I can fake getting data from json file with using $http but with $resource/ $httpBackend I don't get any results $http.get (works) $http.get('api/devices.json') .then(function (result) { ...
4
votes
2answers
79 views

Angular get new scope through another component

I am building a component based app project with angular 1.5.5 I am creating with d3js some .floating-node and for each i create a new $scope and append inside a compiled component. This part of the ...
0
votes
0answers
8 views

UI not updating when mdDialog calls parent controller function

Hi Im having an issue where im showing a mdDialog from Angular Material and using my directives controller as the controller of the dialog so i can call a specific function without having to pass ...
132
votes
5answers
125k views

How to set the id attribute of a HTML element dynamically with angular js?

Provided an HTML element of type div, how to set the value of its id attribute, which is the concatenation of a scope variable and a string ?
0
votes
4answers
29 views

losing scope of ng-model when using ng-include (AngularJS)

I am creating android app using ionic and angularjs. In app i used ng-include for include html content in my page. checkbox.html: <ul> <li ng-repeat="opt in $parent.checkboxOptions"&...
0
votes
2answers
31 views

AngularJS, $resource, get the object from .query()

Need get one object from .query(), service: angular. module('core.users'). factory('User', ['$resource', function($resource) { return $resource('users/users.json', {}, { query: {...
1
vote
1answer
32 views

Angular JS two way binding not updating when using button

I'm a bit of a newb at angular and having a persnickety issue. I am trying to update a variable bound to a div in my controller with a function, that is called when a button is clicked. (The function ...
2
votes
2answers
28 views

Angular app is not defined when adding a custom filter outside of function

Trying to follow some examples, but I get app is not defined app.js (function () { "use strict"; var app = angular.module("deviceManagement",['angularUtils.directives.dirPagination']); }()); ...
3
votes
2answers
3k views

Angular.js Call $http.get from outside controller

I have an HTTP resource that returns a JSON list of top 10 entities from a database. I call it this way: var filter= "john"; var myApp = angular.module('myApp', []); myApp.controller('...
0
votes
3answers
20 views

Get the child input tag for the current checkbox clicked

I am trying to get the child input tag for the current checkbox that is clicked and add checked to it through my directive. I have the directive setup correctly but I am getting undefined when I try ...
91
votes
12answers
92k views

Sending event when angular.js finished loading

Wondered what's the best way to detect the finish of page loading/bootstrapping, when all directives done compiling/linking. Any event already there? Should i overload the bootstrap function?
584
votes
23answers
275k views

AngularJS : Prevent error $digest already in progress when calling $scope.$apply()

I'm finding that I need to update the my page to my scope manually more and more since building an application in angular. The only way I know of to do this is to call $apply() from the scope of my ...
0
votes
1answer
16 views

Update text area when scope is changed

So I have a text area defined with an ng-list that will separate the elements in an array into their own line. <textarea data-ng-model="names" data-ng-list="&#10;" data-ng-trim="false">&...
0
votes
2answers
32 views

AngularJS if/else in ng-repeat

js i have this... controller: "photogridCtrl", templateUrl: 'js/ng-assets/templates/directives/photogrid-view.html', scope: '=info' in my controller i have 2. $scope.home = [ { img: '...
1
vote
2answers
16 views

how to get access to controller scope when testing directive with isolate scope

I have directive with isolate scope and controller, Is it right to write unit tests for directive and test some functional in controller scope? And if it right, how i can get access to controller ...
0
votes
2answers
37 views

angularjs filter not filter multipe filter value

Am looking for angularjs multiple condition filter like this arr in array | filter:filters.search | filter:{company: selectedName} | filter:{voucher_type: both } It working but not filtering all ...
0
votes
0answers
11 views

ReferenceError: FieldSetController is not defined (APEX)

I have a angularpubsub.js which has all the angular factory and services . I have another file controller.js which has all angular controllers for individual visualforce components. But when I'm ...
1
vote
1answer
3k views

Injecting data objects into a directive factory in AngularJS

So I have a directive that takes in data objects as an argument into the scope. The problem is that I handle all my data in my service layer. So this is some normal non-directive code: angular....
0
votes
0answers
16 views

Why my existing template collapse when i use angular material link in my html file

I want to use angular material in my existing website. So i added angular material script link in my html page but when i do that my old ui gets collapsed
1
vote
0answers
34 views

Multiple filter in single function using angularjs

I try to filter two values like this | filter:{voucher_type: selectedName } | filter:{voucher_type: both } Here both is "B" and selectedName "P or R". Below code work only one filter only. I want to ...
0
votes
1answer
37 views

Angular filtering data in javascript is not displaying results and push of data causes error plunker provided

Ok, seems that I was having too many issues with the way in which my Angular site is setup, so I put it in a plunker as then anyone can see it. Original question: Angular retrieve specific data ...
70
votes
6answers
79k views

How do I inject a controller into another controller in AngularJS

I'm new to Angular and trying to figure out how to do things... Using AngularJS, how can I inject a controller to be used within another controller? I have the following snippet: var app = angular....
0
votes
2answers
21 views

Email validation in angular 1.3

I have a form which has couple of text box and a Submit button. One of the text box is an email. I am using angular and below is the code I found from one this reference-: http://plnkr.co/edit/...
2
votes
1answer
39 views

Angular retrieve specific data into $scope variable is not working

I initialize here $scope.statuses = []; Then if I simply set the data from $http.get to the $scope variable, that "works" but I need to filter it down more. $scope.statuses = result.data.Devices; ...
0
votes
0answers
33 views

Acces ng-model in ng-repeat

First sorry for my English. I have two arrays but the important is array bloques: bloques[estado:"", fecha:"",idbloque:"" idbloquec:""materia:""] and bloques have arround 30 elements I have the ...
0
votes
2answers
20 views

How does one set custom validation on an Angular form?

I am trying to set custom validation on an input field in an Angular app. The validation cannot be set to a pattern, since it is based on the content of another field (e.i. Passwords must match) A ...
1
vote
4answers
60 views

In Angular, how to get a form in $scope in controller?

Having these two files: HTML: <form name="registrationForm" ng-submit="registerUser()"> ... </form> JS (inside the Angular controller): $scope.registrationForm.confirmPassword.$...
0
votes
0answers
19 views

Angular 1 - Main App, Services, Directives and Controllers in different modules

I've been trying to add Services, Directives and Controllers and so on in different modules. The code bellow works fine: app.js angular.module('ChuckNorrisFacts.Controllers', []); // Services, ...
1
vote
0answers
46 views

Javascript array push problems [duplicate]

I want to store dates taken from a GET request into the array vm.dates. For doing this I use the function push(), later, I want to check whether the date is contained in the array or not. The problem ...
0
votes
1answer
27 views

AngularJS select model not updating when filter condition changed

I've spend hours trying to find a an answer to the following problem. JSFiddle here Screenshot: I have 2 selects: <label>Animal</label> <select ng-model='myAnimal' ng-options="...
47
votes
4answers
73k views

AngularJS event on window innerWidth size change

I'm looking for a way to watch changes on window inner width size change. I tried the following and it didn't work: $scope.$watch('window.innerWidth', function() { console.log(window.innerWidth);...
0
votes
1answer
119 views

Get variable value in scope from its string name

I have a string in a directive patientCtrl.user.first_name It is a string get from attributes, I need to get the value of the variable instead the string name
0
votes
1answer
19 views

expect statement works for $scope, how do I get my init() function in Karma test?

I have a Karma test spec like this: 'use strict'; describe('Controller: RegistrationCtrl', function () { beforeEach(module('stageApp')); var RegistrationCtrl, scope; beforeEach(inject(...
0
votes
1answer
13 views

Target a value of an array within another array?

I have a json file that has arrays within an array and for the life of me I can't think of how to access a particular value from the inner array when using ng-repeat. So here is a sample of the json ...
0
votes
1answer
51 views

How to push array to nested child object of only matching parent properties?

Below is my json structure: $scope.dataList = [{ CompanyName: null, Location: null, Client: { ClientId: 0, ClientName: null, Projects:{ Id: 0, Name: null, ...
0
votes
0answers
22 views

set uib-typeahead attribute Dynamically

I have a Directive which wraps uib-typeahead, the thing is that I want to populate the uib-typeahead with different arrays of objects which means different names for the keys of the objects inside the ...
0
votes
1answer
24 views

How to pass ng-model value in radio button from ng-repeat into link function on directive

I want one of the Radio Button to be selected once the page is loaded, from another question on stackoverflow i found that Radio Button will be check if the value of the input attribute is equal to ...
763
votes
12answers
350k views

What is the difference between '@' and '=' in directive scope in AngularJS?

I've read the AngularJS documentation on the topic carefully, and then fiddled around with a directive. Here's the fiddle. And here are some relevant snippets: From the HTML: <pane bi-title="...
1
vote
3answers
35 views

Delete database data in angularjs

When I put this link on the browser it will worked. But, When clicked on the button it will not working. What is the wrong in this code. http://localhost/youtubewebservice/shopCartProductDelete.php?...
0
votes
2answers
27 views

Load jquery module after an angularjs view has loaded?

How do you load a javascript file after an angularjs view has loaded? I want to apply a third party script on a view, but it only works when I reload the full page, not when the view is called. So I'...
-1
votes
0answers
18 views

How to find value in resultset based on id

I have an angular application. I query my database to return all "Campaigns". Is there a way to look through the resultset and pick out a specified value, if my angular app already knows the "...
0
votes
0answers
26 views

Can't access a scope property from directive

I want to read an attribute from a directive but when when i want to accees to it (scope.b) it gives me always true and it's actualut an array . This is the directive definition : (function() { '...
1
vote
1answer
2k views

Angular $routeProvider and Controller As Syntax

Can anyone tell me if it is valid to use $routeProvider with Controller as syntax? I am having issues accessing <h1>{{kickController.foo}}</h1> from the controller where this.foo resides. ...
0
votes
2answers
121 views

AngularJS Typeahead error on returning results

I have the following code that makes use of AngularJS and the Angular Bootstrap Typeahead widget. The problem is that it only returns an error- property length of 'undefined'. Any help would be ...
1
vote
1answer
38 views

How to set many unique two-way binding ng-model inside nested ng-repeats (table) in Angular JS?

Link to Plunkr. I want to be able to uniquely change the model of each values, but currently when I type inside the any form field, all of them change. Basically, I have a table created using two ...
108
votes
1answer
35k views

How to do two-way filtering in angular.js?

One of the interesting things Angular.js can do is apply a filter to a particular databinding expression, which is a convenient way to apply, for example, culture-specific currency or date formatting ...
0
votes
1answer
34 views

ng-repeat attribute not working. I am using angularJs but the ng-repeat is not working. Here is my code

<div class="container"> <div class="row" style="padding-top:50px" ng-controller="projects_control"> <div class="col-md-12"> <ul class="media-list"> ...