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

5
votes
1answer
23 views

Encapsulating model in its own class for Angularjs app

I have 2 views. One is to list student in a table and the other is when you click on a student, it shows the details of the student. I have brought the student to it's own class in a separate file ...
2
votes
2answers
15 views

Deep $watch a collection in AngularJS [duplicate]

Here is my object: $scope.steps = { service: { selected_service: '', selected_month: '', selected_year: '', selected_day: '' }, ...
0
votes
2answers
23 views

Passing parameters data to controller with Angular ui router state

I was using $httpBackend and the way I followed code examples I ended up feeling very trapped and cornered ... I had no idea how to make additional ajax calls from my controller as it httpBackend shut ...
0
votes
2answers
42 views

Pass the clicked button id to a function

In the snippet bellow, if you click one of the buttons, then all three buttons will re-act and rotate with the clicked one. How can I rotate only the clicked one? I tried to pass unique id of each ...
3
votes
1answer
3k views

Multiple custom directives on 1 page with callbacks

I have created a custom directive (with some help from SO). It's a full page date picker which uses ngModel to set the date when the user selects a date. At the same time it calls a callback function ...
-1
votes
2answers
27 views

Angular 1.x: Why 2 way binding not working?

I am not using some complex directive, but rather simple multiplication and angular's 2-way binding seems to fail. When I say fail, it's not updating the view when I multiply. But when I click on some ...
0
votes
0answers
15 views

How to handle stateChangeStart event at controller level in angularjs?

I am trying to redirect to home page when specific views are refreshed in browser. If I handle stateChangeStart event on rootScope level, it all works fine and navigates to home page. var payApp =...
0
votes
2answers
29 views

Angular scope not updating after orderBy

I'm building an angular component that renders a table, and I'm running into some issues with the sorting function. The scope in this case looks like this: $scope.listState = { sortBy: '<...
78
votes
7answers
176k views

AngularJs: Reload page

<a ng-href="#" class="navbar-brand" title="home" data-translate>PORTAL_NAME</a> I want to reload the page. How can I do this?
0
votes
2answers
34 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: '...
0
votes
1answer
24 views

How to disappear Bootstrap popover using AngulatJS?

I am using bootstrap popover by this fiddle link http://jsfiddle.net/ivankovachev/U4GLT/ It's working when I click the text the popover is coming. in second click it's disappearing(toggling). it's ...
0
votes
0answers
29 views

Angular js unable to access updated scope in directive?

I created two directives and applied on element. when I alert ng-model in selectControlDir it get value in alert and from cbqControlDir I get undefined in alert. I made some ajax call on load and on ...
0
votes
2answers
41 views

How to call the external controller from angular scope

I am creating a project using angularJS. Here I have many controllers in different HTML files script section. In my home page file, I have to call these controllers and scope values without referring ...
0
votes
1answer
15 views

Destroy event listeners from AngularJS service

I wrote this factory: function myEvents($log, $rootScope) { var service = { broadcast: broadcast, on: on }; return service; function broadcast(name, args) { $...
0
votes
0answers
16 views

How can I update Second Dropdown data based on first dropdown selected item in Kendo Angular js

<select kendo-drop-down-list k-ng-model="testProperty().AssetPropertyType" k-options="GetAssetPropertyType" k-data-value-primitive="true" k-data-value-field="'id'" k-data-text-field="'name'" k-on-...
2
votes
1answer
327 views

ng-model is not updating in select (ng-options)

I need to bind an array into select control and save the selected option to another variable . Please check this plunker code for whole problem and code $scope.actions = [{ name: "alert", id: 1 }, { ...
1
vote
5answers
9k views

AngularJS $http success callback data return

Hello everyone :) Here is the problem. I'm making an angular app with: a factory to access to an api with $http that retrieves an array of objects from a server getObjectsFromApi : function(){ ...
0
votes
1answer
18 views

How can I send a ngRessource request again in error interceptor?

I need to authenticate on a custom oauth2 API. So I use the angular module angular-oauth2. The authentication works. If a request fails cause the AccessToken isn't valid anymore, I need to refresh the ...
7
votes
2answers
9k views

Accessing parent scope in isolated directive

I'm building click to edit directives, but have issues understanding how to access parent scope in an isolated directive. Example: http://jsfiddle.net/ADukg/3591/ scope: {}, It works if I "...
0
votes
0answers
24 views

Update scope in directive and make available for next directive in angular js

plunker for code There are two directive link with a element. HTML <div class="row"> <div class="form-group"> <label class="col-sm-5 ...
0
votes
2answers
52 views

How can I update my view / scope in Angular

In the scope, the "ug" property depend on "user" and "age", when I update "user" or "age" why "ug" isn't update? how can I update "ug" HTML <script src="https://ajax.googleapis.com/ajax/libs/...
0
votes
1answer
20 views

How to hide the DOM element with ngShow/ngHide when condition is not met?

I have a DOM element that looks like <div data-ng-if="allControllerFieldsAreProvided($index)" class="test-controller-connection"> <a href="" ng-...
1
vote
2answers
18 views

Angular: Setting variables inside $on events, need to call $apply?

I am using an angular module then sends messages and I am trying to set a variable to true or false but I notice that they do not get updated in the UI unless I wrap them inside a $apply. Is this the ...
1
vote
1answer
28 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 ...
4
votes
2answers
83 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
2answers
13 views

How to refactor this logic in the template/view to use a single line if statement (AngularJS 1.x)

I am fixing some small issues within our AngularJS application - I've come across the logic below which simply displays one link. In pseudocode style.. if (data.serviceId exists in the DOM) { ...
1
vote
3answers
27 views

How can we get the child scope value in function and toggle it (Angular Js)?

Can we change the dom level child scope value using javascript function? <article data-ng-init="show=true" data-ng-repeat="a in obj track by $index"> <div class="holder"> <...
0
votes
0answers
25 views

Angular JS Templating

i have a template set for all my view pages which i load using app.route('/*').get(core.renderIndex); where and the renderIndex function looks like exports.renderIndex = function (req, res) { ...
0
votes
0answers
18 views

how to clear user login from $scope without refreshing a page

I'm working on my first AngularJS driver application. Currently I stuck on user authentication. Everything works pretty fine, except from one detail. I'd like to clear an username of currently logged ...
0
votes
1answer
48 views

How to solve “Unknown provider” issue in angularjs

When I use ui-router with a resolve it gives a "Unknown provider" error. Below I mentioned the error, that printed on the browser console. Error: [$injector:unpr] Unknown provider: ...
0
votes
1answer
23 views

AngularJS : When to use require 'ngmodel' and require options ( ? , ^ ,?^) in directives

When should I use require: 'ngModel' and require options in directive. I would be happy if someone could explain this in simple language. What is the benefit of each  Require options.
0
votes
0answers
13 views

angularjs ui tree is not functioning while using angularjs 1.5 controller as syntax

I am using Angularjs ui-tree, it is working fine if I use $scope models ($scope.list = [...]) in my controller. But when I am using var vm = this, angularjs 1.5 controller as syntax, then the tree is ...
0
votes
2answers
36 views

How to check the disabled button is true/false ? in angularjs

Hi guys is there any ways on how to check the disable button ?? Here is my button disabled code inside (index.html): ng-disabled="epUpdateAllForm.$invalid || epUpdateAllForm.$pending" In ...
0
votes
1answer
32 views

Pass object to a new page

I have some json which is being ng-repeated: { "title": "image title", "description": "Lorem ipsum dolor sit amet, per ea ferri platonem voluptaria, ea eum ubique ornatus interpretaris. Dolore ...
0
votes
1answer
21 views

Why isolated scope “&” is not working with controllerAs in directive of angularJs

index.html <div ng-app="phoneApp"> <div ng-controller="ctrl as AppCtrl"> <div phone dial="ctrl.callHome('called home!')"></div> </div> </div> app.js : ...
18
votes
2answers
13k views

How do I test $scope.$on in AngularJS

How do I test that the scope is populated after the broadcast? I've searched and found a few QA's here in stackexchange, but none answered my problem. The code is working alright, just don't know how ...
-2
votes
0answers
34 views

AngularJS - fetching data from web sql

What is the standard process to fetch data from web sql in angularjs: i am using controller and service: angular.controller('ListCtrl', function($scope, SaveDataToDatabase) { $scope.items = ...
1
vote
1answer
34 views

How to customize dropdown in AngulrJS?

I have faced some problem in AngularJS dropdown text. Please check below my code JS $scope.work_type_list = { model: null, availableOptions: [ {id: '1', name: 'Print Ready File', ...
-1
votes
1answer
56 views

sending multiple array in multiple array in Angular js

How to send this data in AngularJS. (It's a multiple array in a multiple array which need to send on one Object) [{ "working_day":"sunday", "from_time":{"hour":"9","min":"30"}, "to_time":{"hour":"6","...
96
votes
10answers
110k views

AngularJS access scope from outside js function

I'm trying to see if there's a simple way to access the internal scope of a controller through an external javascript function (completely irrelevant to the target controller) I've seen on a couple ...
0
votes
1answer
57 views

Changing ng-repeat scope in function doesn't update scope

I am using Angular Material in my App. Inside an ng-repeat List i have fields. However i want the user to be able to add often used prefixes to the text. For example if the he wants to type "hours: 5"...
0
votes
3answers
27 views

Pass Service data to $scope controller AngularJs

I have angular app with custom service, in service I request data from server via $http but I can't assign service data to $scope. Here is code for reference... var app = angular.module('jokeRecords')...
11
votes
1answer
39k views

AngularJS evaluate $rootScope variable in directive template

I have a directive that creates an input field. I need to set the ng-model attribute of this input field to the value of a $rootScope variable. The reason behind this is that I want the input field ...
23
votes
6answers
49k views

Angularjs - $rootScope in directive link function

I am asking this question because I am not quite clear on how to think of rootscope as a dependency passed to directives I have a directive that needs to display some information from $rootScope ... ...
0
votes
0answers
16 views

Angular JS and Kendo dynamic Url for DataSource

i have a autocomplete textbox and when a user types into to it i would like to pass the value to the url that the json calls as this would return the data i require in the search this is the html i ...
1
vote
2answers
274 views

Adding an array of objects to an Angular scope object — TypeError

I'm getting this error: "TypeError -- cannot set property 'select' of undefined" in the promise for a repository function. The variable obj contains an array of objects. .then(function (obj) { //...
1
vote
2answers
25 views

How to pass variables from rails controller to AngularJs

I have a rails controller for recipes. I have added some additional variable called @recID. I am able to access this variable successfully in index.json.jbuilder. I can't figure out how to access ...
0
votes
1answer
32 views

Functionality of ng-app directive in AngularJs

please observe the code snippets I've provided below. Case 1: AngularJS Sample Application <div ng-app = ""> <input type="text" autofocus="autofocus" placeholder="Enter your ...
11
votes
3answers
5k views

AngularJs 1.5 - Component does not support Watchers, what is the work around?

I've been upgrading my custom directives to the new component method.I've read that component's does not support watchers. Is this correct? If so how do you detect changes on an object. For a basic ...
0
votes
0answers
42 views

Hi guys.I am using ui-grid for my front end ..but i am getting warning that- unknown attribute 'ui-grid-tree-view'. Kindly suggest [closed]

Please have a look at the official site . This is what i am trying to do in my visual studio 2013. I have added planker.I am getting warning that- unknown attribute 'ui-grid-tree-view' and unknown ...