Tagged Questions
0
votes
1answer
19 views
how to trigger scope watch in directive?
I am trying to trigger my directive code with a scopewatcher:
var gMaps = function($timeout, $q, GeoCoder, mockdataService) {
return {
restrict: 'EA',
template: '<div ...
0
votes
1answer
27 views
angularjs scope two values keeping pointing to each other
Hi I'm trying to copy a scope value from one to another scope. For example:
var items=$scope.order.invoicewindow.items;
$scope.order.orderwindow.items=items;
However right both scopes are ...
1
vote
2answers
39 views
Bind a controller $scope to objects in service
I'm creating a multi-step wizard using angularjs. The steps in the wizard could potentially change by actions the user takes. I'm storing the steps in a navigation service. I want the navigation ...
1
vote
1answer
25 views
Angularjs, dynamically change reference in directive?
is it possible to change the reference from a directive dynamically at runtime ?
i have an input field like that:
<div ng-repeat="header in chartdata.cols">
<input myOwnDirective ...
1
vote
3answers
17 views
Angularjs - How to push items into array based on bool values
I have a simple ng-repeat:
<li ng-repeat="country in getCountryGroups()">
{{country.name}}
</li>
I am trying to only display records if a bool value is true:
My controller:
...
0
votes
1answer
25 views
Accessing elements in JSON file
I am attempting to use a simple $http.get to a .JSON file, which seems to be found, but when trying to pass the data to the front end, i am seeing an error in my console:
Error: data.unitedkindgom: ...
0
votes
1answer
14 views
How do I update a list of items based on a set of selected tags using AngularJS?
I have a simple navigation control in my app that has a list of checkboxes, each representing a tag, and a list of items, each having one or more tags associated with it. When one or more tags are ...
0
votes
0answers
26 views
Angularjs $parse function to multiple controllers for execution
I'm using a validation directive on my views the directive is included on each form when the view is injected. I'm wanting to call the form submission from anywhere in the application and or ...
0
votes
4answers
27 views
angularjs maintain the scope variable across routes
How do I maintain the model across routes. for eg I have a list of profiles loaded onto the home page. The home page also contains a "load more" action to load more profiles, basically pushing data to ...
0
votes
1answer
25 views
angularjs service scope issue after directive event listener callback
I am trying to use an event listener in my angular directive along with a service.
I am having a scope issue as I want 'this' to refer to my service's 'this'.
Right now, in my service, 'this' ...
0
votes
2answers
24 views
How to access the global javascript method using angular $window object?
How to access the global javascript function using angularJS $window object and assign/bind it to the ng-model/scope variable?
Have a javascript method defined outside scope of angular, need to access ...
1
vote
1answer
22 views
Generate random model name in ng-repeat
In my angular.js project, I have a loop which contains a input field
<input type="text" ng-model="myColour">
<div ng-repeat="c in colors">
<input type="text" ng-model="colour">
...
1
vote
1answer
32 views
Why is the Angular filter running twice?
So here is some simple sample code I setup from an example today while I was learning Angular.
jsFiddle link
Couple questions:
How does it know to run categoryFilterFn. I'm guessing anything ...
0
votes
2answers
25 views
Select in directive with transclude not changing parent scope
Fiddle: http://jsfiddle.net/zorro/U8HpP/2/
Below code does not work.
If I remove the transclude and template, it works just as intended.
What am I missing?
<div ng-app="example">
...
0
votes
1answer
13 views
Best practices angularjs ajax request and redirect
I have a originCtrl template and controller. In this one i have a button to go to another template and controller. But on the destCtrl, i need information from an ajax request.
This is a part of my ...
0
votes
1answer
14 views
Having a hard time inheriting scope from parent in AngularJS
So I have the following two controllers, a parent and a child, and I need a value that is dynamically added to the parent scope passed on into the child scope. I really can't understand how the ...
0
votes
2answers
36 views
The way angular bootstraps
I have a question about the way Angular bootstraps. Consider this directive:
app.directive('finder', function () {
return {
restrict: 'E',
replace: true,
...
0
votes
1answer
25 views
AngularJS - get controller name from $scope
Is there a way to get the controller name from current $scope in AngularJS?
0
votes
1answer
32 views
How to update $scope value without $watch for cross-updates
I need cross-update values for both objects
$scope.price = 0
$scope.amount = 1
$scope.total = 0
$scope.$watch('price', function(){
$scope.total = parseFloat( $scope.price * $scope.amount ...
0
votes
2answers
25 views
Can't access value of scope in AngularJS. Console log returns undefined
I'm using ui-router for my application and nesting controllers within ui-view. My parent controller looks like this:
'use strict';
angular.module("discussoramaApp").controller("mainController", ...
0
votes
0answers
14 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 ...
1
vote
1answer
36 views
How to keep cloned markup in sync
Let's say I have a directive can have 1 to n controllers inside it:
<my-directive>
<div ng-controller="myController">
{{ info.name }}
</div>
<div ...
4
votes
1answer
36 views
How to scroll to error in form?
I have just started using AngularJS, I would like to know this approach to scroll the page to the first input with an error when I submit a form.
Here is the way with jQuery :
$('html, ...
3
votes
2answers
61 views
angularjs $q -> deferred API order of things (lyfecycle) AND who invokes digest?
The $q service is very powerful in angularjs and make our life easier with asynchronous code.
I am new to angular but using deferred API is not very new to me. I must say that I completely ok with ...
1
vote
3answers
29 views
How to get $attrs data of children DOM in a controller?
Let say I have a controller and many children DOMs with their own data attributes.
<!DOCTYPE html>
<html ng-app="plunker">
<head>
<meta charset="utf-8" />
...
0
votes
1answer
36 views
Angular JS Binding to Form Within a Controller
I have a form initialized like this --
<div class="col-xs-12 col-md-8" ng-controller="myController">
<form name="userForm" class="form-horizontal" role="form" novalidate>
...
0
votes
1answer
22 views
Angular scope undefined inside $watch and scope variables not available inside $animate function
I have an animation directive that uses scope.$watch to listen for a change on it's attribute, in this case the directive itself. The problem is I need to manipulate parent scope variables from ...
0
votes
2answers
28 views
Angular 1.2.16, isolated scope, parent function and ng-click
I'm stumped with a rather simple issue with Angular (as I think it is simple). Sometimes Angular make me feel dumb, because it can't be possible I'm doing something terrible wrong.
Take this plnkr ...
-2
votes
2answers
29 views
AngularJS - Purpose of Writing $scope Before function($scope)
I started learning AngularJS by seeing few examples in Google, but no where explained about this one. So far i went through few examples where they have written the controllers like
...
0
votes
1answer
15 views
angular module is not defined when writing in coffescript
I have defined a angular app module as below
var dashboardApp = angular.module('dashboardApp', []);
It works fine, but when I rewrite this module in coffeescript, angular report a error
...
0
votes
1answer
27 views
angularJS -Change in variable visible between html links
I have this code:
<li ng-repeat="objekt in driversList" class="mix {{objekt.Objekt.Type}}">
<a href="objekttest.html" data-ajax="false"
ng-click="objekt.Objekt.Active='yes'">
...
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 & ...
1
vote
1answer
29 views
What is the correct way to access a service from an Angular template
I have seen 2 ways to do this. See the service/controllers:
var app = angular.module('myApp', []);
app.service('user', function() {
this.loggedIn = false;
this.logIn = function() {
...
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 ...
0
votes
1answer
50 views
“TypeError: Cannot read property 'name' of undefined” error after Angular page refresh
Sorry if this is a simple problem, I am a newbie to angular and trying to integrate it as a front end for a basic rails blog app. I am a bit stuck on a problem that I think is related to angular ...
0
votes
0answers
14 views
Data-bound input returns undefined even though data is present
In my application (a shopping cart) there is an input field that a user enters a numeric value into. This triggers other databound inputs to recalculate their values.
At seemingly random intervals, ...
0
votes
1answer
42 views
angularjs custom directive isolated scope one way data binding doesn't work
i am a new to angularjs, I read some literature and followed a lot of tutorials, but i am still have the feeling that i completely confused.
My current issue is with custom directive and isolated ...
0
votes
0answers
34 views
attribute @ why here it is needed - AngularJS - Isolate Scope Review
index.html
http://pastebin.com/vGWr03tV
main.js
http://pastebin.com/p2LC7Jdt
phone.html
http://pastebin.com/UZkZsJHw
I dont understand - why in this code when commented number: '@' does not ...
0
votes
3answers
44 views
How to use ng-repeat with in the templateURL of directive?
I created a directive to display the "dropdown". Following are the code i used
HTML
<km-sselect km-left-title="Left" km-right-title="Right" km-model="sdsd" ...
0
votes
1answer
31 views
$observe not working in AngularJS
Cannot get the $observe to trigger anything on change.
.directive('watchContent', function () {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
console.log(attrs.class)
...
0
votes
2answers
29 views
Evaluate $scope assignment
Excuse me, I'm going to be direct here.
I have this function in my controller.
$scope.btnOptionSelect = function(id, value, target_id, target_value)
{
target_id = id;
target_value = value;
...
0
votes
1answer
29 views
Passing control to another controller in angularjs
I am pretty new to angularjs and still getting used to the concepts.
This is the premise of my problem- I have 2 peer controllers (no parent child relationship), controller1 does say steps 1 to 10, ...
0
votes
1answer
21 views
AngularJs custom directive isolated scope custom fields
How can I add custom fields to angular scope along with passed fields as attributes, as the following:
angular.module('app')
.directive("myDirective", function(){
function NewObj()
...
0
votes
1answer
16 views
angular child scope can not refer to parent
I am new to angular and try to figure out how scope works.
I assume that the child scope will inherit scope from parent. see angularjs wiki
In AngularJS, a child scope normally prototypically ...
0
votes
1answer
35 views
AngularJS using ng-repeat value outside of repeat block and in script tag
I am new to angularJS and am struggling with an issue. I've searched extensively for an answer and tried a few dirty hacks as well, but I still cannot resolve the issue.
I have a ng-repeat directive ...
0
votes
2answers
37 views
Display details of selected options in Angularjs
I am new to learn AngularJs. How to display adSet details of selected options?
Here is my app.js file :
app.controller("AddCompaignCtrl", function($scope){
$scope.status = ['active', ...
0
votes
1answer
29 views
Accessing child scope
I am using ngTagsInput angular. My problem comes from trying to gain access to displayTags from a parent root scope. It's not there. I want to gain access to it because the user can add new tags to ...
0
votes
1answer
35 views
Angular Nested Scope Not Responding to Broadcast After Local Modification
EDIT> Here's a better Plunk of what I'm trying to do: http://plnkr.co/edit/E5WU0IJ5eZOJmr393AFU?p=preview
Kept for legacy -> Here's OLD Plunker http://plnkr.co/edit/7q2qJq8LEPtNwcl8RZqE?p=preview
I ...
0
votes
1answer
42 views
can't getting textarea value using AngularJs
<tr class="labels">
<td nowrap="nowrap">Address</td>
<td nowrap="nowrap"><label for="tbAddress"></label>
<textarea name="tbAddress" ...
0
votes
1answer
52 views
Angular using ng-repeat to show hide
i am new to angular and trying to incorporate it within my application.
So far i have been able to set up a simple ng-repeat-start/end which is working as expected.
The issue i am facing is that ...