In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
6
votes
0answers
94 views
AngularJS: $interval's invokeApply parameter does not change anything
From the angular's documentation of $interval service:
invokeApply (optional) boolean: If set to false skips model dirty checking, otherwise will invoke fn within the $apply block.
Which can ...
4
votes
0answers
347 views
AngularFire does not update Firebase sometimes
The controller below feeds a view with a table and a form.
The relevant part of the table is:
<tr ng-repeat="obj in tab.col | filter:filterObj" ng-click="select(obj)" ...
3
votes
0answers
62 views
Why does $digest run all the watches that have been registered on the scope?
I was wondering why $digest runs all the watches that have been registered on the scope, if you had multiple inputs with data coming from the scope in a view, why does AngularJS have to dirty check ...
2
votes
0answers
41 views
ng-model and form inside ng-repeat
I am creating a form for each item in my $scope. ng-model is not linking with the data on my form submit. Any ideas?
<li ng-repeat="item in favourites">
<form ...
2
votes
0answers
73 views
Custom filter overrides original data or causes infinite $digest loop
Initial Situation
TL;DR
I want to filter a nested array with a custom AngularJS filter. Unfortunately not only the data for ng-repeat are filtered but the original object from $scope too.
I have a ...
2
votes
0answers
178 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 ...
1
vote
0answers
51 views
AngularJS ng-repeat - http.gs retrieving data, but not displaying
I am new to angular and trying to integrate it within my application. I am attempting to use a simple $http.get to a .JSON file, which displaying the matching contents in a ng-repeat
Here my get:
...
1
vote
0answers
29 views
Disable ng-click on certain conditions of application for all types of element
In my application I've binded several elements with ng-click directive like below
<a ng-click="DoSomething()"/>
<button ng-click="DoSomethingElse()">xyz</button>
<span ...
1
vote
0answers
29 views
element directive cannot display on page when call from other directive
I am getting a problem while calling colors element directive in draggable directive. when i call colors directive it add "" string in html. I want a select element populated with colors array ...
1
vote
0answers
29 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);
...
1
vote
0answers
55 views
Angular directive in ng-repeat doesn't call link
I'm fairly new to Angular and am having some trouble getting a directive to render within an ng-repeat. This is probably a lack of experience on my part so any help is greatly appreciated.
Here are ...
1
vote
0answers
29 views
AngularJS - multiple use of component with same controller, using different data
I have a simple component that is being included using ng-include. The controller of the component is assigned in the included HTML.
I would like to use the same component twice (or more) but load ...
1
vote
0answers
84 views
Using ng-controller on form causing page refresh?
I am in bit trouble, using ng-controller in form is stopping viewscope refresh.
Html is like:
<div ng-app="App" ng-controller="GetHoot">
//data element
//dom elemet
<form id ="text" ...
1
vote
0answers
27 views
How can I set a cookie to specific path in angular js?
I m developing angularjs project. in here I create a cookie in https:// localhost:8080/private/ path. But I need to create it in here https:// localhost:8080/ . So how can I do it?
I want to set ...
1
vote
0answers
115 views
AngularJS - ngrepeat form input elements dynamically filled with default values to post
http://jsfiddle.net/9sCnC/12/#
I'm going through a json file and parsing it through ng-repeat, a button on each item opening a modal window.
In this window a form is generated with data I would like ...
1
vote
0answers
101 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 ...
1
vote
0answers
52 views
Event with reference dom in angular directive
I have multiple dom like
<custom>sample text1</custom>
<custom>sample text2</custom>
And they will compile with transclude to
<custom><p ...
1
vote
0answers
358 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 ...
1
vote
0answers
37 views
Angular: why isn't $evalAsync called $applyAsync?
Angular beginner question about scopes (docs here).
$eval executes an expression in the context of a scope.
$apply basically calls $eval and then $digest.
Why does $evalAsync call $digest too (or, ...
1
vote
0answers
78 views
File upload using AngularJS and Rails
I have a model BOOK that will insert the book details through angularjs controller
Here is my view:
<h1 align="center">Books</h1>
<div ng-controller="BooksCtrl" class="container">
...
1
vote
0answers
86 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. ...
1
vote
0answers
105 views
adding more than one sources of data to angular
this is what I have in my model
// The contents of individual model .js files will be concatenated into dist/models.js
(function() {
// Protects views where angular is not loaded from errors
if ( ...
1
vote
0answers
78 views
AngularJS: Accessing current object in ng-show function for recursive directive
Given the following code:
http://jsbin.com/EkIqAju/2/edit
How can I access the current object being evaluated in the showQuestion() function in the controller?
I need this to be able to validate ...
1
vote
0answers
123 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 ...
1
vote
0answers
46 views
Getting error when using µ symbol in angularjs
Getting this error i am retriving data from web sql using jaydata.
Error: Lexer Error: Unexpected next character at columns 27-27 [µ] in expression [foodDetail.FoodItem.Vit_C__µg_].
My code is as ...
1
vote
0answers
190 views
AngularJS Table dat refresh based on dropdown list value selected
Interesting to read through your AngularJS articles, especially for new learner.
Currently I am working on a project which has a senario to select parent list control to populate another dropdown ...
1
vote
0answers
175 views
Passing large JSON from JSP to Angular scope
I have a i18n.jsp in which i have a large JSON declared using c:set.
`
<c:set var="Label" scope="session">
<json:object escapeXml="false">
<json:property name="submit"> ...
1
vote
0answers
89 views
$scope.user.id outside of controller
I'm using angular.js and AngularFire and using their chat example. THe point is that the user logs in, then i should set var trueRef to new Firebase("https://alfapixteste.firebaseio.com/users/" + ...
1
vote
0answers
106 views
AngularJS animating prepended $scope data
I have an array named $scope.data with some objects in it, and then I make a call and get older data and I prepend the data to the array.
TestQuery.query({start:0, end: Date.now()}, ...
1
vote
0answers
861 views
AngularJS - dynamically remove directive from element
What is the proper way to dynamically add or remove directive from compiled and linked element?
I have a page that has bunch of inputs there (the list is pretty long, so i want to come up with a ...
1
vote
0answers
103 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
116 views
AngularJS (1.1.5): Can you cancel Directives with priority cancel
Is it possible to keep the built-in ng-click handler from firing when you have a custom ng-click directive with a priority > 0 that fires first? Or to delay the built-in one in some way?
In my case ...
1
vote
0answers
259 views
Angular JS $scope can not find element of array
I'm relatively new to Angular and have run into a problem that I can not figure out what I am doing wrong.
Things work up until I get to the edit record screen.
From the listing page(this works), ...
1
vote
0answers
340 views
Angular custom directive: Access parent scope property in linking function
I want to set the name of an event (click or touch) on a parent scope in angular as a string. On a child scope I want to use that string to bind an event with element.on.
Example:
...
1
vote
0answers
86 views
Scope variable in AngularJS returning undefined
I am working on a little app and I have a service that goes and gets some data and returns it as JSON. I am able to display that data in my HTML just fine. But if I try define a new $scope variable ...
1
vote
0answers
132 views
Layouts in angular
I am trying to develop a simple directive which can take a option of layout configuration.
Lets say i want to render something like this on the page
I want to render this 4 co-ordinates in one ...
1
vote
0answers
401 views
AngularJS - Share ngModel with nested directives and transcluded directives
I am trying to create 3 directives:
.directive('dirOne', function () {
return {
restrict: 'E',
transclude: true,
replace: true,
controller: function ($scope, ...
1
vote
0answers
90 views
Custom filter filter extension pattern?
I'm currently using a filter filter on an ng-repeat which includes a number of search criteria input fields and a global search like this Plunker (ignore the misbehaviour of ng-repeat, this is a ...
1
vote
0answers
120 views
(Help) Input prepopulated with db value, need to be able and save back to db
Very new to AngularJS (and javascipt in general).
Here's what I currently have that I know works:
1) Input with db data
2) Working function that submits to PHP
I currently have an input populated ...
1
vote
0answers
106 views
Manage complex UI with hiding/showing windows without losing scope/control
With angular js, How can I manage an complex view layout that allows the hiding and showing of windows (and so on.) I need to do so without loosing any state or scope while reopening windows if the ...
1
vote
0answers
367 views
Angular scope, ng-repeat, and calling method on ng-click
I'm a self taught novice programming working on developing a web application using node, angular, bootstrap, and the graph database neo4j.
I'm hoping to get some pointers on what I'm doing wrong in ...
1
vote
0answers
506 views
Angular set ng-minlength from controller does not work
Here is the controller:
function Ctrl($scope) {
$scope.text = 'guest';
$scope.word = /^\w*$/;
$scope.min_length = 4;
}
Here is the view:
<form name="myForm" ...
1
vote
0answers
313 views
promise-tracker in AngularJS
I have problems when using promise-tracker.
What I want is to track a conversation. And part of my code is following:
js:
angular.module('myModule', ['ajoslin.promise-tracker'])
...
1
vote
0answers
167 views
Binding and changing mapped objects in AngularJS
I am creating a spreadsheet-type app with AngularJS and it takes a CSV file, parses it, filters it with some regular expressions, and then outputs the data. However, the data is color-coded.
The ...
1
vote
0answers
94 views
pass scope to out of function in angular
i am beginner in angular, so sorry if my question is dummy
i have some code like this
var data = [];
$scope.dataObj = {};
resourceTag.getTag({tagName: 'قیچی'}, function(json){
...
1
vote
0answers
236 views
AngularJs - RequireJs - Access controller from module on ng-click
I am new to both Require and Angular. My question is how to access a controller on ng-click if the controller is hosted in a module. In My case I have to following files:
-- This is controller ...
1
vote
0answers
510 views
Temporarily suspend data-binding in AngularJS to update model without firing $scope.$watch
UPDATE 4/19/2012 12PM PST: Gotta eat crow on this one. The problem was not with Angular's databinding but with math errors in how I was calculating the dates. I wasn't properly taking into account the ...
0
votes
0answers
13 views
Trying to get a string from Angular UI Modal via resolve object
I'm using the Angular UI modal directive: http://angular-ui.github.io/bootstrap/
I'm trying to pass a string from my modal open() function to my modal controller via the resolve object. I feel like ...
0
votes
0answers
6 views
angular js filtered rows have updated data, but not binding to UI
I have a table in which i am displaying project names with some other related informations. User can search for some text inside project also. I am using solr for that, i'm getting the response & ...
0
votes
0answers
15 views
Load Angular library on specific pages
I am trying to integrate Angular in to parts of my web application. When i say parts, i mean there are a number of pages with either just static text or images which it does not make sense to load a ...