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
18 views

IONIC App-Horizontal, scrollable thumbnail slider

there is a list of orders. When we click on >(right chevron detail option), it redirects me to order detail page. Order detail page may have a list of items ordered by one person. Each item has camera ...
0
votes
1answer
10 views

Ionic- display picture taken with camera on same page

I'm trying to display image captured through camera on the same page without visiting phone's memory. Somewhat like watsapp, the way we click and upload right away from there only. So, it is like we ...
0
votes
2answers
18 views

Pass value of scope to another scope in AngularJS

I have a controller and want to pass a value of a scope to another. app.controller("ChatController", function($scope, $firebaseArray, $timeout, $firebaseAuth, $window) { var ref = firebase.database(...
19
votes
2answers
14k views

Why isn't $destroy triggered when I call element.remove?

I can't figure out why the $destroy event is not triggered in the following example. Can someone explain why it is not triggered, and in what scenarios it will be triggered? Here's the plunkr: http:/...
1
vote
2answers
29 views

scope.$destroy is not triggered

I have created a plunkr demo of the problem. The problem I'm facing here is fairly simple: calling $destroy manually or removing the element doesn't fire the $destroy event. function link(scope, ...
54
votes
5answers
61k views

How do I share $scope data between states in angularjs ui-router?

Without using a service or constructing watchers in the parent controller, how would one give children states access to the main controller's $scope. .state("main", { controller:'...
0
votes
0answers
14 views

How to display a perticular tab of a page when back button is clicked using AngularJs?

I am having a page with 3 tabs. In that, only 3rd tab have a button called "Show Line". If I click on that button it will load a new page(graph). If I click on back button on that new page(graph), I ...
8
votes
5answers
17k views

angularjs: $scope update when I change a select with jQuery

I'm using a jQuery plugin to 'customize' my selects. This plugin fires the change event of the original select when some option is selected. The problem is that my scope doesn't change. Here you ...
0
votes
1answer
29 views

How to send URL parameter from angularJS to MVC action

I am using the state provider for mapping the urls , and the following is my AngularJS code. .state('uimenucategories', { url: "/MenuCategory.html", templateUrl: "/AppMenuMaker/...
0
votes
1answer
21 views

why scope variable is not accessible in angular components

I have written a angular directive to read the file input data. However the updated scope variable is not accessible when I click on update button. why I am unable to access the file variable that is ...
0
votes
1answer
29 views

how to fill empty array with objects updated in directive?

I started my adventure with Angular directives. Somewhere in my app I have to choose number of passengers. Then I have to assign "First Name" and "Last Name" for each of them. So I created simple ...
0
votes
0answers
8 views

angular.element(…).scope(…) is undefined in s3

<html ng-app="myApp" ng-controller="myctrl" id="myctrl"> <head> <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <script type=...
0
votes
2answers
25 views

AngularJS acces controllers $scope inside state onEnter function

I have a state inside my angular .config $stateProvider and I want the onEnter method gain access to the controllers $scope of the state. My state is declared like this: .config(function($...
2
votes
1answer
44 views

AngularJS Directive doesn't update scope for callback

I am using directives to create a component library in AngularJS 1.5. Hence, my directives need to have isolate scopes. Some of my directives have callbacks so you can pass in a function to get ...
0
votes
1answer
22 views

Two way data binding in isolated child directive

I have a form which contains a fieldset, Form can have varying number of this fieldset, so I have a add more button in the form. There can be a situation where form has no fieldset. To fulfill these ...
1
vote
1answer
13 views

Angular: using $rootScope.$on vs $scope.$on to catch a $rootScope.$broadcast in a component – what is better in terms of performance?

Hi I’m wondering what is better in terms of performance. Let’s say I have this factory that broadcasts stuff: angular.module('core.foo') .factory('Foo', ['$rootScope', function ...
1
vote
1answer
17 views

How can I know from which directive is called a function that is defined on the $rootScope?

I have multiple directives and in every directive I call a function which is defined on the $rootScope. I want to find a way to tell from which directive the function was called without sending the ...
0
votes
1answer
24 views

pass value from angularjs directive link function to templateurl

I am trying to build a angular directive as shown below <!DOCTYPE html> <html lang="en" ng-app="directiveModule"> <head> <meta charset="UTF-8"> <title> Angular ...
0
votes
3answers
23 views

How to add a progress bar in ionic app

I really need your help, I am new to ionic project. Currently working on a project. This app pulls blog post from wordpress using $http. How can I add a progress bar to tell the users that the page is ...
11
votes
5answers
12k views

Dynamic form name attribute <input type=“text” name=“{{ variable-name }}” /> in Angularjs

How would someone use formName.inputName.$valid when the "inputName" was dynamically created? <form name="formName"> <input ng-repeat="(variable) in variables" type="text" ...
0
votes
2answers
20 views

Pass Angular $scope object to PHP to Hubspot Form

I'm trying to pass Angular $scope values to a Hubspot form by calling an AJAX function. I'm making calculations in the controller and then I would like that data to be input to a corresponding ...
0
votes
2answers
29 views

Bootstrap tabs not hiding with ng-show

I have a requirement where I have two buttons: A and B A has 3 tabs associated with it- a,aa and aaa B has 3 tabs associated with it- b,bb and bbb The page should initially load with A active(css ...
0
votes
1answer
29 views

angularjs dirty checking rate

I was reading some article to understand a little bit more how angular.js works. I understood what is 'dirty checking($digest)'. But on what rate the watchers are listening for dirty fields? And ...
0
votes
2answers
15 views

scope resolution operator angularjs

Is there a way to use a scope resolution operator, like in c++, to use a parent $scope variable instead of the one in the current $scope. I have two controllers, a Root ctrl and a Settings Ctrl. The ...
1
vote
1answer
377 views

Error: [$injector:unpr] Unknown provider: chart.jsProvider

I am trying to use this plugin https://github.com/jtblin/angular-chart.js. And I am getting this error (I don't think the problem is with the plugin instead it's in the way I'm doing the injection!!): ...
806
votes
13answers
378k 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="...
0
votes
0answers
29 views

Angularjs ng-click doesn't work inside scope (Firefox only)

I just play around with angularjs and its functions. I simply try to click a button and return a string in console.log. When I click the button, nothing happens even no error message is visible. What ...
1
vote
1answer
37 views

How to Pass the Angular Variable to Another Angular Google Chart Function(Angular Directive)

Can someone help me in approach for passing Angular Variable to Google Chart Function which is present in the same Java Script with Angular Directive And Also I wanted to load Google Charts to load ...
2
votes
3answers
59 views

Can't save http result to scope

I have a json-file defined and I am trying to load in one of my controllers. I am using a factory to fetch the data: .factory('myService', function($http) { var all_data = []; return { ...
0
votes
1answer
36 views

AngularJS Controllers

Recently faced angularjs controller behaviour. Someone accidently from team did structured DOM like this : - <div ng-controller="firstController"> <div ng-controller="secondController"> ...
0
votes
2answers
218 views

ng-model value of select element is undefined

Here is my View In whichI have 3 drop downs. That I am trying to fetch value in my controller where I am getting 'undefined' <div class="row"> <div class="input-field col s12"> ...
1
vote
3answers
23 views

What should I do before removing a DOM element in AngularJS?

I remember hearing about needing to destroy the scope on an element before removing it from the DOM. But I'm not exactly sure how that is done. So, it just so happens that I have a directive that ...
0
votes
0answers
17 views

Unwrapping Restangular service promise / view not getting updated

I'm trying to unwrap a promise so that my view gets updated when I click a submit button. In the controller, I first call getProfileDetails() that returns an object of details. Here is the controller: ...
0
votes
1answer
36 views

IONIC APP- [$injector:unpr] Unknown provider:

I'm getting this error and have been looking for it on the google but still couldn't solve this issue. ionic.bundle.js:26799 Error: [$injector:unpr] Unknown provider: $cordovaCameraProvider <- $...
811
votes
13answers
339k views

How to access the $scope variable in browser's console using AngularJS?

I would like to access my $scope variable in Chrome's JavaScript console. How do I do that? I can neither see $scope nor the name of my module myapp in the console as variables.
0
votes
2answers
24 views

Access Angular2 app through window loses scope of “this”

I have an Angular2 app that I have exposed certain methods to code running outside of ng2. The problem is that this is not the same when called outside of ng2 vs inside. https://plnkr.co/edit/...
0
votes
1answer
38 views

How to change all directive scope value from any one of directive?

I have a directive which was repeatedly n times. I have click event action in every directive. Whenever I click, on click function, It change some scope variable names which defined in directive. But ...
0
votes
1answer
46 views

Not seeing scope in directive

I have a controller that passes two variables to my view via $scope. I can display those variables in the view. In my view I have a directive, where I pass in the two variables to the directive scope....
0
votes
1answer
48 views

angularjs submit button not working

I'm validating & submitting a simple form using angularjs, the form seems to do some initial validation but the submit button does not log or executes the angular function defined to it. What am I ...
0
votes
0answers
24 views

Table displaying count of data with conditions AngluarJS

I am trying to create a table like below: Number of days Count Over 3 days 3 Over 20 days 4 Over 30 days 5 So I get back a total count of things open over 3 days etc. Problem 1: ...
-2
votes
0answers
21 views

aangularjs scope binding shows “?” string after bind

angularjs cordova other language charecter shows '?'(the charecter changes while binding at $scope) please helpenter image description here
1
vote
1answer
54 views

Angular 2 animations (using a different animation library e.g GreenSock Application Platform)

Im just curious since I have been playing around with Angular 2 and it uses it its own api to do animations, is now possible to use a library like GSAP to construct the animations but let the api ...
1
vote
2answers
31 views

How to get second value variable in an array from dropdown selection in controller?

I'm looking to get the variable of the second value in an array list that a user selects via dropdown in my controller to do some math functions. $scope.dropdown = [ {name:'Name', value:'123'}] So ...
0
votes
1answer
15 views

Force update of html5 video source in angular js project

I have a project where I've embedded an html5 video on a view. I populate the source dynamically using $scope. The initial video I populate the player with works fine. At the end of the video, I ...
739
votes
5answers
572k views

How to use $scope.$watch and $scope.$apply in AngularJS?

I don't understand how to use $scope.$watch and $scope.$apply. The official documentation isn't helpful. What I don't understand specifically: Are they connected to the DOM? How can I update DOM ...
0
votes
1answer
17 views

$Scope.$Apply() returns a circular error after loading data into an Angular-Ui-Grid

An example: The code is triggered by this HTML: <div google-chart chart = "chartObject" style = "height:600px; width:100%;" agc-on-select="selectHandler(selectedItem)" ng-if="chartvisible"></...
0
votes
2answers
37 views

Loose Scope in angular JS

I have a multiple tab Html page . On one tab i have add 3 input box and an add button. Whenever the add button is clicked the data to be added into a grid below. But scope is not accessing these ...
0
votes
1answer
26 views

Unable to see scope variable in angular

i am trying to use django with angular js here is the controller myHeader.js var myHeader = angular.module('myHeader', []); myHeader.controller('HeaderController' , ['$scope', function($scope){ ...
0
votes
1answer
10 views

How to dynamically load temple in angularjs diretive without ng-include?

I want to dynamically load templateUrl in angularjs directive without ng-include.
0
votes
2answers
25 views

Comparing objects from two scopes to provide a value

I'll try to simplify the problem as much as I can. Let's say I have 2 scopes $scope.section1 = [ {label: 'label1'}, {label: 'label2'} ]; $scope.section2 = [ {value: 'one'}, {value: 'two} ];...