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 directive not picking up the values set by parent

I have a directive that has a div, whose visibility is set by its parent. Expecting "show" to be true, but the div is still not visible initially on page load. Directive: <div ng-show="{{ show }}"...
1
vote
0answers
35 views

Using Resolve In AngularJS Routes to get Json data

I'm trying to get Json data in AngularJS Routes and then inject it to the controller. A resolve contains one or more promises that must resolve successfully before the route will change. This means ...
0
votes
1answer
12 views

Error: [$compile:multidir] when using multiple directives on same element

I made a form for credit cards payment which contain many validations, on the input below I try to validate 2 settings, one is the card type (visa,diners,amex, etc...) and the second validate is for ...
-1
votes
1answer
30 views

How to trigger the function after DOM markup is loaded in angular style application except onload

I need to show a Simple current time with an angular based-application.So have tried a demo. In the body onload function execute the piece of function. <body onload="startTime()"> function ...
-1
votes
0answers
40 views

Angular constructor function possible memory leak

In our app we use constructor functions intensively, but whenever we are initializing a scope object with new and constructor function it is placed on the Heap (Open Profiles in chrome dev tools and ...
0
votes
0answers
23 views

Angular JS : Uncaught DOMException: Failed to execute 'removeChild' on 'Node' on HTMLScriptElement.callback

I am using Angular JSON Http call. in the same When I make the post request like this : app.service('AjaxService', [ '$http','$q','$sce', function($http,$q,$sce) { return { ...
0
votes
2answers
37 views

Using $location.url() inside a directive not working in angularjs

I have a directive and inside it, I used the $location.url() but it seems not working, and I think I need to inject something on my app but I don't know where to inject it. By the way I'm new to ...
1
vote
1answer
42 views

angularjs country code look up from jsonfile via $http request

I am trying to look up country codes from a json file to get the full country names: $scope.fullname = function (option) { $http.get('files/names.json').success(function (data) { for ...
0
votes
1answer
35 views

How to create a modal using angular components?

I'm pretty new to angular, and I'm trying to create a modal as a component (trying not to use ui-bootstrap or libraries) and I'm having trouble wrapping my head around it. My code: App.component('...
1
vote
1answer
29 views

google map does not show properly

how to call initmap method in angularjs because. map does not show... properly when i use $scope.mymap = function(){} when i clicked refresh button its working fine, but when i change the tap, and ...
-1
votes
1answer
36 views

Angular JS live select dropdown search filter

I am grabbing some news items from a newsfeed REST API and have implemented a free text instant search. I am now trying to implement a search from a dropdown list that works with the same data but I ...
2
votes
2answers
45 views

“$parent” in multi-level directives

I am trying to understand a working code. It can build a very simple json data by adding name:value pairs one by one with GUI; by a custom directive and its link function, it builds a html template as ...
1
vote
0answers
29 views

Can a directive inherit a ng-click from his parent scope?

I am trying to work with ng-view directive and I want to batter understand the parameters of my scope and controller. my web page has a static part and inside of it the ng-view directive like so: &...
0
votes
2answers
33 views

When does ng-class ends expression evaluation and applies the class?

I'm trying to reach something similar to a FullScreen-mode feature: using a button to trigger the fullscreen mode, then another button to return. The subject: <div ng-class="{full: !...
-2
votes
0answers
29 views

Angular JS : Is it ok to have 92 watchers on a page? [closed]

I am making an application and I have 92 watchers on page. I came to know this through a plugin named : $$Watcher I have read in a blog that it is ok to have up to 2000 watchers on the page, Do I ...
1
vote
0answers
36 views

Angular service to share data - Is this the correct approach?

Hello Angular Gurus, I'm using a service to share data between two controllers. I'm sharing data between BankController and CreateBankController. What I observe is that the CreateBankController ...
-2
votes
1answer
35 views

How can I display $scope in browser console? [closed]

I am trying to use AngularJS for the first time in one of my projects. The book I am following pointed me to the AngularJS Batarang Chrome extension to inspect the $scope. Unfortunately installing ...
0
votes
3answers
35 views

rootScope variables are null after time

i'm developing an app with ionic that should save some variables like rootScope variables at the login and reuse these variables in http requests during the run of the application. My problem is that ...
0
votes
4answers
53 views

AngularJs Custom Directive scope data overwritten

I have displayed the products based on branch and billing account. In the product template, i have a "+" button, if we click on the button, then i'm displaying the particular product id below that ...
0
votes
1answer
21 views

Angular 1.5 directive with one-way binding updates parent scope

I have a directive with an isolated-scope and one-way binding variable. yet when i change that variable in the directive controller it updates the parent scope as well. Example code: function ...
0
votes
0answers
39 views

Angular two forms, two ng-click, same function, only the first one runs

I have two forms on a page. The first adds an item to the database, and the second is prepopulated with the data and allows the user to modify the item. The first form allows the user to create and ...
1
vote
2answers
48 views

$scope variable do not respond to the onClick function of angular chart

I have a chart in the page. When one click in the chart, the onClick function will be called and it will know which category of the chart has been clicked by user. I created a div to show $scope....
0
votes
3answers
27 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
15 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 ...
0
votes
2answers
39 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
3answers
35 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
27 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
25 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"&...
0
votes
1answer
20 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 ...
0
votes
1answer
16 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 '...
1
vote
1answer
24 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 ...
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
28 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)...
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
35 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
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", []) ....
0
votes
1answer
32 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
2answers
53 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
51 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. ...
0
votes
0answers
35 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
9 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 ...
0
votes
4answers
19 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
58 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
62 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. ...
-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
64 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 ...
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 ...
0
votes
2answers
31 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
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
2answers
34 views

Model updates in directive do not update view

angular.module('myApp') .component('sideNav', { controller: function SideNavController($scope) { $scope.navigation = {}; $scope.click = function(key) { $scope.navigation[key] = !$...