Tagged Questions
In AngularJS, a scope is an object that refers to the application model. It is an execution context for expressions.
4
votes
0answers
387 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)" ...
2
votes
0answers
45 views
AngularJS $rootScope in factory - reload data
I have a factory calling a $resource. Upon refreshing the application entirely, this works as planned. But it not call the resource again throughout navigating the application. Ideally i would like ...
2
votes
0answers
36 views
Angularjs create scope object using Object.create
I am learning AngularJS by building a web application. Have a prototype object in my service module (in the fiddle, I have mocked it within the controller).
Now when I try to update the child element ...
2
votes
0answers
25 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
119 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 ...
2
votes
0answers
77 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
90 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
291 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
19 views
How to rerun controllers after global data is resolved?
I resolve data on application load in a run block...
.run(function($rootScope, $q, teams, schools, news, games){
// go out and grab all the relevant data
$rootScope.showSplash = true;
$q.all([
...
1
vote
0answers
39 views
How to Modularize AngularJS app(folder structure)?
assume i am going to strart new angularjs app with 3 modules
1.login
2.payment
3.enquiry
i want to load payment module with login details similarly for enquiry . how can we achive this
i will have ...
1
vote
0answers
28 views
Directive Does Not Inherit Controller's Scope
I have a controller set up which contains a few functions to do form validation. In this controllers $scope I have an array $scope.errorMsgs that is populated with strings of error messages the user ...
1
vote
0answers
20 views
How can I set a Translated Title in AngularJS
There are other answers that show how to set a HTML title in AngularJS. This is my variation which works for basic cases even while using angular-translate:
<title ng-controller="PageCtrl" ...
1
vote
0answers
43 views
How to prevent calling of a service when hitting refresh button
I have problem in angular. I have made a service that should authenticate the user that service has two variables which are var isAuth and var IsAdmin;which indicates the state of the user.
In the ...
1
vote
0answers
42 views
Angularjs unit test watch callback not getting called even with scope.$digest
I'm struggling unit testing a controller that watches a couple variables. In my unit tests, I can't get the callback for the $watch function to be called, even when calling scope.$digest(). Seems like ...
1
vote
0answers
78 views
Custom Filters in kibana Dashboard
In Kibana, I am trying to create filters with default values similar to the existing time filter in header. I went through the code and found that this function is taken care in ...
1
vote
0answers
34 views
AngularJS - JSON and return all results
I'm trying to write a basic search function using AngularJS. I have written a service that finds my JSON file and binds it to a $scope object $scope.SearchResult
What i am trying to do it perform a ...
1
vote
0answers
33 views
Data binding with `ng-model` not working on some systems
Quite strange, but yes the same code works on one system but not on the other.
I developed a HTML-5 based extension for Adobe Creative Cloud Applications (Adobe CC have the chromium framework built ...
1
vote
0answers
22 views
angular.element replaceWith not working
I have an element to replace and the html text is in varaiable h
The first call to this works perfectly. But the second call does not.
var newElement;
var h="<div>a</div>";
newElement = ...
1
vote
0answers
62 views
Sometime scope variable not getting set
This seems pretty strange to me but I hope there's someone that has come across this before and point me in the right direction.
I have a variable being set in scope within an $interval and the ...
1
vote
0answers
87 views
angularjs ng-click not working inside the pop over directive
I added some buttons in the pop over template.
when the page finishes the first loading, click on the element on the page, shows the popover, click on those buttons, every one works fine. But when ...
1
vote
0answers
28 views
Getting error while calling function from element attributes
Trying for creating multiple progress bar with dynamic value
<progressbar class="progress-striped active" value="{{getValue(value.currentStatus)}}"
type="{{getType(this.value, ...
1
vote
0answers
35 views
Confused with angular tutorial step
From https://docs.angularjs.org/tutorial/step_11 unit test section:
it('should create "phones" model with 2 phones fetched from xhr', function() {
expect(scope.phones).toEqualData([]);
...
1
vote
0answers
34 views
ng-options is not displayed all the time in AngularJS
I have a small problem when I load my page. Sometimes, my ng-options has blank values. I don't understand why. I can load the page 10 times without problem, but I can load the page with blank values.
...
1
vote
0answers
23 views
Can access an object via console during debugging, but code throws an error
This problem is honestly the strangest thing I have encountered. I have no idea whether or not it's able to be reproduced, so I'm just asking for some input on possible causes.
The code is ...
1
vote
0answers
218 views
Sidebar transition using AngularJS using scope.apply not working
I have 2 sections of a page
1. Sidebar menu
2. Page content
When I click a button on the page content the slide bar menu should slide out. I am trying to achieve this using ngClass of Angular JS.
...
1
vote
0answers
71 views
AngularJS directive to format model value for display but hold actual value in model
In angularjs I am trying to build a directive for currency textbox which takes values (amount and currency code) from the model in scope and then apply currency formatting to it. I am really having ...
1
vote
0answers
121 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
80 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
39 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
65 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
102 views
Communication between nested directives
I'm trying to communicate between a parent directive and its nested child directive, and the other way. I've managed to achieve this by using $broadcast and $emit, but because I'm passing in some ...
1
vote
0answers
50 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
36 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
310 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
62 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';
...
1
vote
0answers
82 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', ...
1
vote
0answers
287 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
59 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
550 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
55 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
115 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
140 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
119 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
86 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
158 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
49 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
193 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
716 views
Creating dynamic scope variables
I am trying to create dynamic scope variable.
Here is the json object:
{
"status": true,
"res": {
"call": [
{
"percent": 100,
"name": "150+"
}
],
...
1
vote
0answers
184 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
107 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/" + ...