Tagged Questions
2
votes
3answers
30 views
AngularJS Expression in Expression
Is there a way to have AngularJS evaluate an expression within model data?
HTML:
<p>
{{Txt}}
</p>
Model:
{
Txt: "This is some text {{Rest}}"
}
{
Rest: "and ...
0
votes
0answers
11 views
Displaying user Data from Firebase with AngularFire
Here's what I'm trying to do:
I'm using AngularJS and firebase in a project where:
1. an anonymous login happens, then
2. a record in a firebase datastore gets created for that login with an ID I can ...
0
votes
1answer
17 views
In nested Angular directives, can the child directive inherit a variable from parent's isolated scope?
Let me explain what I'm trying to do. I would like to have the following html:
<outer data="variableFromAppController">
<inner></inner>
</outer>
variableFromAppController ...
0
votes
1answer
17 views
ngTable custom refresh action?
I have a table showing data from a remote server. There is a numeric input, when the number is changed I want the table to be refreshed (with the numeric input in arg).
Here is my current attempt:
...
1
vote
2answers
26 views
Force ng-repeat to rerun function in data binding
I'm using ng-repeat in a table to show a list of items and their prices.
The price is bound to itemPrice(item), defined in my controller.
The function calculates a price based on $scope.orderType.
...
0
votes
1answer
20 views
AngularJS - ng-repeat to display empty cell/s when data is not available when using slice twice
I have a simple ng-repeat that loops through a JSON file with a list of countries and details about that country e.g. currency, population for a particular set of months (24 in this case)
My ...
0
votes
0answers
7 views
Angular location change resetting browser history
I'm watching for a change on $locationChangeStart, if the user is on Step2, and they try to go to Step1 via the browser back button, I have successfully interrupted this, displayed an alert, and will ...
0
votes
1answer
35 views
How to set the selected value for multiple select elements in a single AngularJS context
I try to create multiple select elements on a AngularJS page in a single context. names is a array of available name objects and cores is the array with available cores. For each name, I would like to ...
0
votes
1answer
29 views
infdig Infinite $digest Loop
I'm learning AngularJs but I cant make it works.
I read about the digest cycle but it is not clear for me.
It's obvious that this code fails because enter in a infinite loop, but I dont know how to ...
0
votes
0answers
14 views
Acceessing function in controller of another application's controller angularjs [duplicate]
I am new to angluarjs, so...
The problem that I have is accessing function in angularjs controller which is placed in another application(project inside same solution).
From project "Common" (which ...
1
vote
2answers
29 views
Bind normal js variable as an angular object key
I have an array of objects, objects, and a a few JS variables holding static strings, such as static1, static2 ... How can I accomplish the following:
<tr ng-repeat="obj in objects">
...
0
votes
1answer
27 views
Scope is not shared between nested transcluded directives
There are two directives collection and element, both of them transclude it's content, both of them have scope: false (default value).
This directives are used as wrapper on some container and ...
0
votes
2answers
19 views
Angularjs - Function is undefined in child scope even though it is in the parent scope
I have this plunkr: http://plnkr.co/edit/vuN0zVhXNMHUEPMeRvRg?p=preview
In this plunkr, I call a directive which gets the function "test" from parent scope using the "&" operator.
Why when I try ...
0
votes
1answer
28 views
Know if AngularJS directive method binding defaults to angular.noop
I have a simple directive that passes a function on to a plugin; the plugin will then use the function with a given value. For simplicity, let's ignore changes on the data:
...
0
votes
1answer
30 views
Dynamically create directives from a loop
I have a main directive that has an array on it's scope that contains data for constructing other directives that should be compiled and appended to the main directive.
The problem is that when I ...
1
vote
0answers
26 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([]);
...
0
votes
0answers
48 views
angularjs: (bootstrap) popover directive. How to close it?
I have a pattern related question. I build a directive to "load" content into a bootstrap popover.
HTML:
<span data-ng-show="user.provider === 'local'" class="label label-warning" ...
0
votes
1answer
29 views
use service for ng-class in AngularJS?
Do you think if it's possible to use a service/directive/... for ng-class ?
What I mean is that I use the same ng-class in several partial view.
<div ng-repeat="s in statut">
<div ...
1
vote
1answer
23 views
view is not updated in AngularJS
I have an issue when I try to display data.
I send my form and update my database (it works great, backend is ok)
I use a button on the page to return to homepage
The view of the homepage is not ...
0
votes
1answer
13 views
Access from external function to scope
I have a problem with the external function OnLoginFail when invoking the function showFormAndHideMessage from it.
I try using
angular.element($("login")).scope().showFormAndHideMessage().$digest(); ...
-1
votes
1answer
23 views
How can I compare two values in angularjs in HTMl
How can I compare two scope values using angularjs in HTML only?
for example:
<div ng-if="place.id = place.reference.id"> show if equals</div>
I want this to cover certain scanrios
0
votes
0answers
9 views
How to lazy load panel content on a button click having multiple panels on the same page using angularjs
I have a scenario here where I have multiple panels (using ng-repeat) on the same page. Each panel have a link, on click of which it loads data specific to that particular panel and returned response ...
0
votes
1answer
29 views
How to set the id attribute of a HTML element dynamically with angular js?
Provided an HTML element of type div, how to set the value of its id attribute, which is the concatenation of a scope variable and a string ?
0
votes
1answer
30 views
How to pass the ng-model into a function instead of ng-model's value?
I want to create a single function that will be used for total project.
It will work based on the ng-model passed into it.
For ex:-
$scope.checkBoxValueChanged=function(model) {
...
0
votes
1answer
13 views
AngularJS flushing scope beetwen views
I have an issue with a recursive function call in one of the view of my app:
The structure is the folowing:
ng-view -> Home
ng-view -> TrackPosition (using phoneGap)
on my TrackPosition view I have ...
0
votes
1answer
24 views
Angular transcluded directive as sibling scope incompatible with child directive's require: “^parent” setting
I'm having an issue with the way AngularJS handles transcluded scopes for directives. It is known that a transclude's scope is a sibling of its directive's scope, not a child. Shown here
However, I ...
0
votes
2answers
38 views
Access ng-repeat repeating data inside appended html
I am appending some HTML into a model item when that item is clicked using custom directive.
My code:
<div appenddata>
<div ng-repeat="model in models">
<label ...
0
votes
2answers
24 views
Bind part of ng-model with scope in angularjs
In my application i have array of colors and i want to create a list of colors with checkbox.
var app = angular.module('app',[]);
app.controller('mainCtrl',function($scope){
$scope.colors = ...
0
votes
0answers
38 views
$scope change not applied in angular 1.2.16
I'm currently upgrading a matured application from angular 1.0.8 to the 1.2.16 release.
Within the application we we do have a lot of directives that encapsulate bootstraps typeahead. Something like ...
0
votes
2answers
38 views
How do I populate a scope with a http response?
The problem I have is that on page load the response from the API takes a while and my view (scope) is empty. But when I switch view back and forth the groups-view (scope) is updated with the object ...
0
votes
1answer
27 views
AngularJS directive isolated scope can see one = binding, but not another
I'm trying to pass some simple, numeric parameters into a custom directive. (I keep getting connection timeouts from Plunker, so please bear with me.)
HTML
<body ng-controller="MainCtrl">
...
2
votes
3answers
40 views
How to call controller function from directive?
how to call controller function from directive? or howto access directive ng-model from controller?
eg. I use angular ui bootstrap time component and when time change I need to notify calling function ...
0
votes
2answers
33 views
What's the proper pattern for local $scope functions in controller?
In my controller I have several local functions that are related to the $scope. They seem to get out of control now as that number increases. What is the proper pattern to structure these local ...
1
vote
2answers
39 views
input return number instead string in AngularJS
I have a form with several inputs. It works fine but the problem comes when I fill the input with the number 0. Other numbers are good. 1 is interpreted "1" etc.
Only problem is 0.
I would like to ...
1
vote
1answer
33 views
filter date returns NaN-NaN-NaN in AngularJS
The filter I created below works on Chrome but not Firefox. I don't understand why.
myApp.filter('dateCustom', [ '$filter', function ($filter) {
return function (input) {
// input => ...
1
vote
0answers
30 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
1answer
20 views
Can I use a filter inside a filter in AngularJS?
I just create a filter to convert my date to time. And I would call in the official filter "date" of AngularJS.
project.date_created_at and project.mel don't have the same format. So I need to create ...
0
votes
1answer
17 views
angularjs switch between directive templateurl and $http service
I am having following directive
app.directive('myPage', function() {
return {
restrict: 'E',
templateUrl: app.urlBuilder('about')
}
})
This directive will be loaded by ...
0
votes
0answers
50 views
AngularJS, cannot access $scope.variableName
I am new to AngularJS and having an strange problem, that I can't access to $scope.name. In the factory DataService I have a method getData() which uses $http.get(...).
angular.module("app", ...
0
votes
2answers
34 views
Is only one $watch created regardless of how many DOM elements are bound to the watched $scope?
In the following code, is there only one $watch created even though the <input> element and interpolation of the double curlies {{customer.name}} create two different bindings to ...
0
votes
1answer
18 views
angularjs udefined method when trying to call method from services to controller
Here is how I created my service
app.factory('PageService', function($http) {
return {
getPageTemplate: function(url) {
return $http.get(urlBuilder(url));
}
}
})
...
2
votes
1answer
91 views
TypeError: undefined is not a function in Angular Resource
When trying to poll a custom method copies on an AngularJS Resource I get the following error at angular.js:10033: (The method copy works just fine.)
TypeError: undefined is not a function
at ...
1
vote
4answers
72 views
Why is it that I see {{ … }} before loading in AngularJS?
Do you know why is the {{ project.title }} before I see the real value of the scope.
And how to solve that ?
EDIT : <title>{{ pageTitle }}</title>
Page is loading
Page completely ...
1
vote
3answers
26 views
angularjs ngrepeat and ngif
I am new to angularjs I am trying to create a tab so I created an array of content like this
$scope.panels = [
{ title: "About", url: "about", active: true },
{ title: "Contact", ...
0
votes
1answer
19 views
Why won't my view template bind to a scope variable with AngularJS?
My view is:
<div class="container" ng-controller="MyController">
<div class="row">
<div class="col-md-8">
<textarea class="form-control" rows="10" ng-model="myWords" ...
0
votes
1answer
29 views
How to share data and calculations across multiple controllers in Angular?
This is my first project using AngularJS and, unfortunately, it isn't exactly a gentle introduction. I have had to "hit the ground running" so to speak.
I am tasked with building a customizable ...
-1
votes
1answer
49 views
Angular scope won't get defined
I'm learning Angular and I'm facing a new issue which takes me long to figure out where the problem is
I try to inject
konfigurator.factory("ConfigurationService", function($http) {
return {
...
0
votes
1answer
23 views
Parameter not passed to Handler in nested Angular Directive
I have "Pages" property which contains an array of "Page". Each "Page" have an array of "Control" exposed against "Controls" properties.
I have written Directive to render markup for Page and ...
1
vote
2answers
35 views
AngularJS which scope does an ng-model point to?
Still training myself to think In angularian...
I think that it would it be correct if I think of the ng-model attribute as a reference to some data element in some parent scope... [would it?]
I am ...
0
votes
1answer
140 views
AngularJS “cron jobs” - run action on every $digest
I want to execute some function on every $digest cycle.
The documentation for $scope reads:
If you want to be notified whenever $digest is called, you can
register a watchExpression function ...