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
3answers
24 views

Angular JS : Error while getting data from typeahead

I am getting error while loading the module for angular JS in my Module, UI bootstrap here is not getting loaded despite of all the dependencies resolved. can any one help me ? Fiddle Link https:/...
0
votes
1answer
13 views

Angular $destroy method not called on page navigation in Rails app

I have an application that uses both Angular and Ruby on Rails. Some of my Angular controllers create $interval timers that need to be cancelled when the user navigates to a new page. This Stack ...
2
votes
1answer
117 views
+50

Passing a binding to transcluded scope in component

In Angular 1.5, I want to pass a binding from a component into the (multi-slot) transcluded scope - for a reference in the template (in either one specific or all of them - no either way is fine). ...
0
votes
2answers
32 views

AngularJS - Factory variable doesn't update in controller

I'm facing a new issue with AngularJS. Infact, since I need to have a "shared" variable, readable and updatable in 2 controllers, I thought about doing that with a factory injected in both the ...
0
votes
1answer
67 views

AngularJS factory and controller

little problem here, i have a controller which communicate with factories, but how can i pass the factory result to a function? Something i tried: .controller('testCtrl', ['$scope', 'foo', 'boo', ...
1
vote
2answers
863 views

angularjs nvd3 Line chart not updating the data

I'm using angular-nvd3-directives to create line chart. This is the HTML file <div class="line-chart" ng-controller="LineChartController as viewAll"> <nvd3-line-chart data="viewAll....
3
votes
2answers
98 views

angular: centralised resource factory with promises

Let's say I have a resource that looks like this: angular.module('productsModule').factory('productFactory', function($resource) { return $resource('/products/:id',{}, {'query': {method: 'GET'...
8
votes
2answers
9k views

angularJS $broadcast and $on

is there a way to make the $broadcast propagate the variable to the $on during initialization phase? <div ng-app='test'> <div ng-controller='testCtrl'> <span>{{testContent}}</...
0
votes
3answers
28 views

Access the main controller's scope from inside a directive

Suppose the following blueprint code: <div ng-controller="myCtrl"> <div ng-repeat="..."> <div ng-repeat="..."> <div ng-repeat="..."> &...
0
votes
1answer
24 views

how to use google map in angularjs with script of key Without Google SDK

i don't want Google SDK, i have following code..i but its show error when i use tag its working fine but i am using angularjs its show error , normal page with script in page its working fine..how ...
0
votes
0answers
24 views

Calling link function as to reset message

Here is a part of my code: <div class="col-xs-5 col-lg-5"> <select ng-model="criterion_id" ng-options="..." > </select> </div> <div ng-if="criterion_id===1"&...
11
votes
1answer
13k views

What is the difference between `value` attribute and `ng-value` attributes in angularjs

What is the difference between value and ng-value attributes in angularjs templates? If I use ng-if on the field using value attribute it works properly but if I change the attribute value to ng-value ...
0
votes
1answer
19 views

How to toggle data in one directive using an ngClick function in another?

I'm building a weather app using Angular 1.5.8 and need to give users the ability to toggle back and forth between imperial and metric measurements for the temperature and wind speed. The toggle ...
1
vote
1answer
21 views

AngularJS model update reverting back to original

http://plnkr.co/edit/3UMwSK6H5VL0pZujL7Qh?p=preview Click edit and then cancel. The text boxes do not go away. Click cancel again, they go away. Please tell me why this is happening. I am losing my ...
4
votes
1answer
514 views

How to make template without ng-repeat and pass data to $scope with angular-drag-and-drop-lists?

I want to use angular-drag-and-drop-lists with my own grid template to WYSIWYG editor. How to build my own HTML template without ng-repeat so it will be able to drop items in any predefined column and ...
0
votes
0answers
14 views

Angular: Passed params in nested directive is of state “undefined”

We are following an example from http://mfauveau.github.io/angular-query-builder/ and modifying it to fit into our requirement. We have a modal view(.jsp) that has integrated directive (named as '...
0
votes
0answers
11 views

how to add google api script angularjs page

How to add this script in angularjs please help me.. when i click from page ng-click="ListCtrl.Location(engineer)" below method call and show other page Location(engineer) i have below HTML page ...
0
votes
1answer
27 views

AngularJS: Passing into a directive link function an attribute AND the entire scope

I have a directive that has an attirbute, it looks like this: <directive config="myConfig"></directive> This is my directives code: app.directive("directive", ["$compile", ($compile)...
41
votes
3answers
91k views

Call a method of a controller from another controller using 'scope' in AngularJS

I am trying to call a method of second controller in first controller by using scope variable. This is a method in my first controller: $scope.initRestId = function(){ var catapp = document....
0
votes
2answers
21 views

Isolated scope's property does not affect its parent

Here is my code: <html ng-app="myApp"> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script> <body> <div ng-controller="...
0
votes
0answers
34 views

AngularJS: How to add setter on $scope object property of directive?

This is my current implmentation to fire callback on customVar get change using $watch... module.directive('mudirective', function() { return { scope: { callback: '&' ...
0
votes
1answer
30 views

Access controllers of multiple identical directives sharing the same parent scope

I am having trouble with an angular directive used an an attribute on a component. Basically, I want buttons to be draggable. I do it this way: <body> <xx-button xx-draggable> <xx-...
0
votes
1answer
25 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", []) ....
18
votes
3answers
34k views

Get to get all child scopes in Angularjs given the parent scope

I would like to know how to get a list of all child scopes given a parent scope. All I can find from the properties of the scope are $$childHead, $$childTail, $$nextSibling and $$prevSibling. The ...
1
vote
4answers
54 views

Angular Controller not console logging data. However, Service is passing in the data.

I have my backend linked to the service. When I invoke my function on a controller it executes the function in the service and console logs the data. The data from service to the controller is being ...
0
votes
2answers
39 views

passing scope to directive in angular js

I have the following Angular controller with a simple http get in it: angular.module('SCtrl', ['ng-fusioncharts']).controller('SCtrl', function($scope, $http) { //Get All errors. $http({ ...
2
votes
1answer
38 views

Issue with protractor test case: Process exited with error 1

I'm fairly new to protractor and writing test cases.I tried to run this test case as shown below which is to open a page and click on "Home" which then takes back to another page added as expectation. ...
8
votes
4answers
5k views

Share async data between controllers without making multiple requests

I'm trying to make a single $http request to get one of my JSON files and use the data across all my controllers. I saw on egghead.io how to share data across multiple controllers, and I've also read ...
0
votes
0answers
33 views

$broadcast and $on is not working on single click

In my angularjs application I am using $emit and $on to show to different section of page. For code refer to this link. How to use $emit and $on of angularjs for two different controller stored in ...
0
votes
0answers
8 views

Angular 1 - How to use a Prototypal Scope and Bind values from Attributes without Watches?

I'm working with angular 1, and I'm currently wondering how to create a child directive that has a prototypal scope, and who contain an isolated value from an ng-repeat directive. The following ...
1
vote
2answers
38 views

How to refresh directive that existed in template and directive has own scope for data

I have - ng-view - template create item functionality and same template containing one directive that load the saved items. Now, when i do save create item and immediately, its not refreshing list of ...
86
votes
4answers
81k views

Call a controller function from a directive without isolated scope in AngularJS

I cannot seem to find a way to call a function on the parent scope from within a directive without using isolated scope. I know that if I use isolated scope I can just use "&" in the isolated to ...
15
votes
2answers
10k views

Directive scope attributes without an isolated scope in AngularJS

Is there a way of inheriting the parent scope while extending it with passed attributes? I want to pass parameters to a reusable directive directly from the template without having to alter the DOM ...
0
votes
1answer
63 views

How to use $emit and $on of angularjs for two different controller stored in different path

I have two views and its resp controller. Say view1.html and its controller firstCntrl and view2.html and its controller secndCntrl. In view1.html: There is Link2 which will be redirected to ...
0
votes
4answers
17 views

Persisting Scope beyond get request in Angular

I have the following code: $http({ method: 'GET', url: 'http://localhost:8080/getStuff' }).then(function successCallback(response) { $scope.stuffData= response.data.length; }, ...
0
votes
1answer
51 views

angular service not returning success in controller after the work is done in service

I am calling a method inside a Service and when the work of service is done it should return to controller with the data, and continue the work further, but after the service is called and data is ...
1
vote
3answers
51 views

AngularJS - split controller functions in multiple files

I'm new in AngularJS and I'm doing a refactor of an AngularJS application and I noticed that there is a single controller file with a lot of functions that manipulate and set scope variables. ...
0
votes
1answer
17 views

Merge two SCOPES from separate sources (same construct)

I have a function var getData = function() { $http.get('(url of remote site)/swi/20?expand=true').success(function (data) { $scope.listOfServices = data.runningServices; }); }; Which ...
-1
votes
0answers
6 views

how to show image in pop..page of information already pop page (nested pop)

i have below code i want to show image in pop... but the page of information its already pop page. how to show nested pop... please see code and picture setGetImage(historyimage) { console.log('...
0
votes
6answers
56 views

How get data in controller of both ng-repeat field along with outside ng-repeat field

I am working on angular Project.I have two divs. In one div there is dynamic input which generating through ng-repeat. Initially, two input will be available but if the euser clicks on add more than ...
4
votes
1answer
8k views

How to use SASS in Ionic framework?

I am trying to use SASS in my project. I open this link and follow all command. I create a project and setup SASS. http://learn.ionicframework.com/formulas/working-with-sass/ I got this directory ...
0
votes
2answers
206 views

Angularjs storing $scope variable

I'm building a web app using Yeoman Angular-fullstack. I'm confused about how to update my $scope variables so that once a change is made, the results are automatically displayed on the html page ...
0
votes
2answers
28 views

convert array into an object angularjs

I have a contoroller: $scope.getFromDB=function(data) { $scope.nameSelected=[]; var myCookie=$cookie.get("nameCookie"); $scope.names= data; for(var i=0; i<$scope.names.length;i++) { if($...
0
votes
0answers
37 views

How to attach Excel file on send email in Angular.js?

I am using Angular.js to create an Excel file but now I include also that file in my email from how to that possible. My js code: $scope.email = function () { var blob = new Blob([...
0
votes
3answers
32 views

usage of ng-if and ng-switch inside ng-repeat fails

I am trying to compare userId with currentuserId and when the condition of action is approve i am trying to populate checkboxes. But my ng-if seems to be failing always. How can i do this better . ng-...
0
votes
0answers
19 views

Status of newly opened window in AngularJS/JQuery

<!DOCTYPE html> <html> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> <div ng-app="myApp" ng-...
0
votes
5answers
3k views

How to update scope variable value in view after http call?

I am making my first project using Angularjs 1.4.3. In my controller I am making a http request, in the success method of this http request I am updating a scope variable. In http call I am getting ...
13
votes
2answers
7k views

How can I pass an ng-repeated object to my AngularJS directive?

Take a look at my code here... Controller ("tasks" is an array of JSON objects resolved in my Routes.js): app.controller('testCtrl', function(tasks){ $scope.tasks = tasks.data; }; HTML: <...
243
votes
5answers
36k views

When writing a directive in AngularJS, how do I decide if I need no new scope, a new child scope, or a new isolated scope?

I'm looking for some guidelines that one can use to help determine which type of scope to use when writing a new directive. Ideally, I'd like something similar to a flowchart that walks me through a ...
0
votes
1answer
343 views

How do I display HTML content, which is retrieved from the server using AngularJS?

Actually I have an HTML file in the server that, contains img tags, JavaScript and CSS code. I'm trying to get the content of this file using the $http service and display it inside a twig file using ...