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

3
votes
0answers
268 views

How to trace source of $watch model updates in AngularJS?

In my multi-user AngularJS app, I have a model object on my scope. This model can be manipulated by both user input and server updates. I have a $watch observer to track the model and update the UI. ...
3
votes
0answers
548 views

Difference between template and templateUrl in angular js directive in isolated scope

I have a directive in isolated scope and i define a couple of variables in link function of the directives so the template fails to bind to these variables but templateUrl seems to bind to these ...
2
votes
0answers
58 views

How to make angular bindings work on dynamically created dom items?

I am trying to make constructor of web page. Here is the plunker. I have headings, paragraphs, lists and so on. I drag them from menu and they are cloned and pasted into dom. Similar to this one ...
2
votes
0answers
23 views

currentPage not being assigned to zero on filter- AngularJS

I am using default Angular filter, On change of text searchItems is called with search string: <input type="text" ng-change="searchItems(searchquery)" ng-model="searchquery"> the inside the ...
2
votes
0answers
98 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 own grid template to WYSIWYG editor. How to build own html template without ng-repeat so it will be able to drop items in any predefined column and store ...
2
votes
0answers
108 views

Automatic persistence of ng-model values

Current question is logical continuation of this question Abstract Hi, I'm trying to automatically persist ng-model values on per-history step basis. So that when a person clicks browser's ...
2
votes
0answers
321 views

Angular js : Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource

I am getting this error when I am trying to post data using $http.post() in Angular Js. Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at {{post url}}. ...
2
votes
0answers
162 views

Angular ui-sortable + angular-gridster

I'm trying to combine the functionality of ui-sortable and angular-gridster so that I can pull an item from a list and drop it into a rearrangeable grid. ui-sortable and angular-gridster have the same ...
2
votes
0answers
159 views

How to bind AJAX-loaded form to 'ngModel' [close]

Received http://examle.com/ajax/login.html: <form method="post" action="/login.html" name="formLogin" data-ng-model="formLogin" data-ng-submit="submitLogin($event)" novalidate="novalidate" > ...
2
votes
0answers
82 views

Getting a list of all events that can potentially pass through an angular scope. $$listenerCount?

Inside a directive I am trying to get a list of all event names that can potentially be captured by the given scope. When observing the scope object, I can see that there is a $$listeners property, ...
2
votes
0answers
231 views

How to handle many to many relationships with Angularjs' $scope variable

I have two services that hold my two objects which have a many to many relationship; Missions (or steps/actions) and the Tools needed for these Missions. Each Mission can use many tools and each Tool ...
2
votes
0answers
1k views

Adding Multiple 'require' Options for Angular Directive

Usually in Directives, I use require: 'ngModel' if I want to pass the scope to it. This works fine. But I am now creating a directive that creates 5 different HTML elements each with different ...
2
votes
0answers
135 views

element.replaceWith(otherEl) makes directives loose functionality

At a specific event, in the link function, I change the view html, like this: var html = $templateCache.get('otherTemplate')[1]; var dom = angular.element(html); element.replaceWith(dom); ...
2
votes
0answers
80 views

Angularjs app scope variable not available to the view

In my angularjs code below why is the IsLoggedIn and Username not available to the view. Not sure what's wrong, any help will be highly appreciated: 'use strict'; ...
2
votes
0answers
131 views

directive scope not binding with $resource

I'm experiencing a very strange issue and cannot see what I'mn doing wrong... I have a pretty simple directive: var widgets = angular.module('widgets', []); widgets.directive('wdgtImageThumbnail', ...
2
votes
0answers
632 views

$setPristine() does not work properly if form control has invalid data

I am trying to reset form using $setPristine(). $scope.resetDataEntryForm = function() { $scope.dataEntryForm.$setPristine(); $scope.pr = {}; }; It works fine if all the input controls in ...
2
votes
0answers
765 views

Angularjs - ng-model undefined

I am building a rather complex directive in which I need access to ng-model on a specific element in the template which is enclosed into ng-if directive... I have a plunker and the explanation on how ...
2
votes
0answers
432 views

Scope problems in basic Yeoman Angular Todo App

I'm following the tutorial here: http://www.youtube.com/watch?v=iUQ1fvdO9GY while learning yeoman and angular. I've gotten to here http://www.youtube.com/watch?v=iUQ1fvdO9GY#t=266 and where his ...
2
votes
0answers
257 views

Sharing isolate scope with nested directives in Angular

I want to have a custom directive that is reusable and creates an isolate scope so it can be used anywhere (as long as the consumer uses the API defined by the directive). Then, I want the consumer ...
2
votes
0answers
156 views

Do angular directives on the same DOM element share a scope?

If two angular directives are attached to the same DOM element do they both share the same scope? The angular documentation implicitly indicates this is the case, If so, what is the best practice for ...
1
vote
0answers
22 views

Why isn't my child directive able to read from the parent scope?

I'm just fiddling around to practice with Angular...I was making a child directive with isolate scope configured such that it would automatically get updates from the parent scope but you would have ...
1
vote
0answers
24 views

How to delete a directive which has an isolated scope from the DOM properly

I have a directive with an isolated scope. How can I remove the directive from the DOM properly? I read that I have to remove the element from the DOM but before I also have to destroy the scope of ...
1
vote
0answers
19 views

Select-style dropdown in Angularjs disappears after selection

I am attempting to create a select-style dropdown list with angular js. My immediate problem is that once the user makes a "selection", the list goes completely blank. When I run the following in ...
1
vote
0answers
21 views

Directive for finish ng-repeat not being called when using filter

I've got this simple directive: myApp.directive('repeatDone', [function () { return { restrict: 'A', link: function (scope, element, iAttrs) { var ...
1
vote
0answers
36 views

AngularJS with WebRTC and Socket.IO scope issues

I'm currently working on a video-conference call application with AngularJS, WebRTC and Socket.IO. I've stumbled upon an issue and am not sure how to fix it. Basically I have a list of rooms which is ...
1
vote
0answers
25 views

Sporadic value updates in html

I have an AngularJs decorator directive that adds functionality to an html5 video player. I am trying to get the speed (playbackRate) to display in html when the speed is increased using the (l/r) ...
1
vote
0answers
63 views

how to validate form in ionic using angular js

I am trying to use ionic framework with angular .I want to do validation of my form on button click.Mean I need to validate all field on button click .All field are required ..I need to show error ...
1
vote
0answers
21 views

why angular service attribute changes can not affect the relative value in the controller scope?

Here is my code brief: controller: angular.module('testApp').controller('TestCtrl', function ($scope, EssayRsc, EssaySvc) { $scope.pageInfo = EssaySvc; } service: ...
1
vote
0answers
31 views

Adding Tags work on create page, but wont work on edit page angular

I'm trying to build an app with meanjs so most of it uses angular. The idea is for the user to be able to add tags and delete tags to a certain post. Add and deleting works great on the create page ...
1
vote
0answers
47 views

AngularJS Digest Cycle Occasionally Fails to Update Scope

Angular Devs! I'm running into a bit of an issue when using ngAnimate and UI-Router together. Basically, I have five child states ("slides") that make up my main content as well as a button on each ...
1
vote
0answers
70 views

How does ngRepeat work

I'm preparing a presentation for a talk so I drawn a diagram on how ngRepeat works. The focus of the talk is ngRepeats role in performance pitfalls but I'am not sure if everything is right in the ...
1
vote
0answers
58 views

ng-show and ng-if lags to hide content

I have the following in to show and hide the clear button based upon if the searchQuery is empty or not. When a user starts typing in the input box, the button shows instantly. However, when the ...
1
vote
0answers
72 views

AngularJS Theory: Difference between creating new object vs assigning variable in scope

I have a question relating assigning a variable vs a new object in scope. Take the plnkr example where I have an on/off canvas menu (http://plnkr.co/edit/bJsDuEd9QPG65HMdkAIQ?p=info). Within the ...
1
vote
0answers
46 views

Batching DOM updates from directive

I am wondering if there is a way to batch the actual dom writing when the contents of a directive is written to the DOM. The use case is a large DOM where I want to optimize by updating the DOM in ...
1
vote
0answers
29 views

Bind to scroll and watch the argument - better way?

I wanted to create a simpler version of jQuery Waypoints.js (sticky elements on the page) in AngularJS. I created a special directive to watch the scroll and it looks like this: ...
1
vote
0answers
114 views

One input element, one ng-model attribute, with multiple directives

Goal: create an isolate-scoped directive that, when applied to an input element with an existing ng-model directive, constrains the value of the model arbitrarily, reflecting the changes back to the ...
1
vote
0answers
38 views

automatic download with hidden anchor tag not wokring on firefox

This code working fine on chrome but not in firefox. ANy idea what could be the issue? var element = angular.element('<a/>'); element.attr({ href: ...
1
vote
0answers
55 views

Trigger $scope.$watch into AngularJS directive with the same value

I have the following ambiguity. I write AngularJS directive and use $scope.$watch into it. When there is change on watched value I made several DOM manipulations into directive. This is me code ...
1
vote
0answers
147 views

How to force recompile of directive with isolated scope?

There are a few SO posts about refreshing a directive when a (model) value changes: Angular Directive refresh on parameter change AngularJS directive gets not updated if scope variable changes The ...
1
vote
0answers
94 views

$scope issue with angular-strap $modal on route change

I use angular-strap(http://mgcrea.github.io/angular-strap/) to display modal dialog from controllers like this - myModal = $modal({ scope: $scope, template: 'template.html', show: false, ...
1
vote
0answers
74 views

Sharing a regularly updating json data feed between 2 controllers angularjs

I have an application that reads from one regularly updating public flickr feed (e.g. https://api.flickr.com/services/feeds/photos_public.gne?tags=christmas&tagmode=all&format=json). When you ...
1
vote
0answers
117 views

Trouble to fetch data from an object in Ionic Framework

I have an angular controller which returns an object from which I need to show data using ng-repeat in ionic framwork. But I am facing issues while doing so. Below is my controller.js file. ...
1
vote
0answers
74 views

UI.Bootsrap conflict with AngularJS password matching

The problem stands as follows: I have a fully working angularjs code for password matching: var app = angular.module('ngMatch', []); app.directive('match', function () { return { ...
1
vote
0answers
113 views

How to check and uncheck all sub checkboxes for a header checkbox using angularjs?

I need help in selecting\unselecting all checkbox subitems and identifying under which heading what all subitems are selected on click of appy filter button. For debugging purposes I am using ...
1
vote
0answers
27 views

Initialise Revealjs using ui.router

In my app there are two kind of views: aViews having simple html code with no controller. bViews having js-code (RevealJs). When I navigate from a bViews to a aViews, Revealjs apply his change ...
1
vote
0answers
1k views

Unknown provider: $templateRequestProvider <- $templateRequest <- $route <- ngViewDirective

I'm just starting with angular.js and I watched some older tuts. where ng-route was not a dependency, so I have changed my code and added <script ...
1
vote
0answers
51 views

How to bind filtered result to another action with Angular?

I am trying to develop action bar with search functionality. Demo: http://plnkr.co/edit/lWoHw7Aiwacln4GAHfNm?p=preview The action bar updates when selecting/deselecting files without any search ...
1
vote
0answers
56 views

angular link scope variable undefined into template

I have defined a directive that uses ui.calendar as sub directive: angular.module('calendar.availability') .directive('calendarAvailability', ['$http','$modal','$log', function($http,$modal,$log) { ...
1
vote
0answers
282 views

Accessing parent scope from a child controller with ControllerAs syntax

How can I achieve the following using Controller-As approach: app.controller("parentCtrl", function($scope){ $scope.parentObj = {prop1: "not set", prop2: "something"}; $scope.doSomething = ...
1
vote
0answers
144 views

Need to execute a Shell Script from Angular JS UI

I need to execute a shell script on click of a button using Angular JS, can anyone tell me how can this be achieved ? I need to pass a few inputs(Parameters,Arguments) to that shell script before ...