1
vote
1answer
21 views

Angular - resolving for multiple controllers in the same view/route/page

We are building a big SPA , currently the app is build with widgets/components. each with a template, controller. but many can be nested in the same route. for example: In the route /users/ I can ...
0
votes
1answer
21 views

Newbie Angular Q - Modifying service output

I've been working on my first angular app all day and have a basic question. The goal is to create a text field with two strings describing the current url route and action like the following: You ...
1
vote
1answer
23 views

Angular not scoped method

I am wondering, does all the methods declared in an angular controller have to be added to the scope? is it possible to call a controller method from ng-click="myMethod()", with my method not delared ...
0
votes
1answer
27 views

How to $watch changes on models created by ng-repeat?

Consider this Plnkr for example. I don't know how many members of fooCollection will be created beforehand. So I don't know how many bar models are going to exist. But I know they are going to be ...
0
votes
1answer
18 views

How to reach a function from a directive that is defined in the inline controller

If I have a directive, that has its own controller defined in its body: directives.directive("formWrapper", ['User','$location', function(User, $location) { return { ... template: ...
0
votes
0answers
27 views

Custom AngularJS attribute inside the directive with HTML page template

I want to create two directives: one of them should be an simple tag and another one should be an attribute for this tag. Another words I want to make something like this: <outer ...
1
vote
0answers
27 views

patch request using angularjs

I am working on an API using djang-tastypie as backend and AngularJs for front end. I am sending request fro CRUD using angularjs $http. GET, POST, PUT everything is fine but when I am trying to send ...
2
votes
1answer
24 views

update an angular model using ng-repeat

How do I get $scope.animal to update when clicking the radio button? http://plnkr.co/edit/5ikIYfXQw4GyjRKScD7x?p=preview var app = angular.module('plunker', []); app.controller('MainCtrl', ...
0
votes
1answer
51 views

Cannot read property '$scope' of undefined

When I receive a html content in angular app, I inject it in the html document, but then can't get it. Example minimized code on plunker and in javascript I have next controller: class ReadCtrl ...
0
votes
1answer
15 views

AngularJS - Trouble with directive changing value in controller

I'm getting large images from an API in my main controller. I have a directive that successfully lets me know when each image is loaded: app.directive('imageonload', function() { return { ...
0
votes
0answers
18 views

angularjs directive accessing original nested elements

Pretty basic scenario, just not sure how to approach it I have an angular app, I have an element restricted directive that uses a templateUrl to bring in a partial. The partial works fine and looks ...
0
votes
0answers
16 views

Linking and controller function of directive which is represented as an attribute of another directive don't work

Have the following problem. I want to make two directives. One of them will be an attribute for another. Something like this. <html> <title>Directives</title> <head lang="en"> ...
3
votes
1answer
68 views

angular.js directive templateUrl fails to bind scope

I'm creating a directive that will display and show content by listening to the $routeChangeError event on $rootScope. I got it all to work by inlining the template like this: app.directive("alert", ...
0
votes
1answer
17 views

Select Last HTML Select element from multiple select elements using AngularJs

Hello guys I am working on an application where I am using django-tastypie as backend and AngularJs for front end.I am totally new to AngularJs. In my template there may be multiple HTML tags based ...
0
votes
2answers
29 views

Calculate mathematical expression within string in angularJS

How do I evaluate the mathematical expression within a string and assign it to a numerical value in angularJS? Eg: var value = 10; var someValue = "Math.min(value * 0.22, 106800)". I need someValue ...
0
votes
1answer
27 views

Angularjs creating questionaire that allows ranking choices

I'm creating a questionaire for users that allow them to choose and rank personality attributes that best match them. There are three choices in each row and everytime they click on a choice it ...
1
vote
1answer
62 views

Recursion using Angularjs and Append Elemnts to an HTML Template

I am quite new to Angularjs . I am working on an app which use Angularjs for front end and django-tastypie for back end. What I am doing is i have a topics list where topics are nested in each others ...
0
votes
1answer
21 views

Applying math rules (like rnd, max etc) to value entered by user using AngularJS directive

I have sum calculation rules defined as below, where 2013 represents the year and 5 and 6 are some codes sent over to the program: app.run(function($rootScope) { $rootScope.MATHRULES = { ...
0
votes
2answers
16 views

Why does changes to the outer scope from within a directive require scope.$apply() even if I am setting scope option to false?

Lately I've noticed that changed to some angular - provider objects, or to my own - outer scope(out side of the directive, in the controllers) required wrapping the code in scope.apply(). can anyone ...
2
votes
1answer
53 views

Isolated scope for directives

I'm having some troubles understanding isolated scopes in Angular directives. I've read the official documentation, watched a lot of videos about the subject, so now I'm know what's the purpose of ...
0
votes
0answers
69 views

AngularJS: $rootScope.$on not receiving msg sent via $rootScope.$broadcast on v1.2 of angular

has something changed between angular 1.2 rc2 and angular 1.2 with regards to broadcast and receiving the broadcast ? I have what I think is a standard broadcast in a controller in a $watch i.e. ...
0
votes
6answers
67 views

AngularJS - refresh list after adding new record to collection / db

How do I update/refresh my $scope.list when a new record is added to the db/collection - storage.set() method - please see comment in the code. Please see code below. angular.module("app", []) ...
1
vote
1answer
34 views

AngularJS Directive - Receiving a broadcast from $rootscope

I have the following code, HTML <div ng-app="test"> <div ng-controller="containerCtrl"> <component data-module="components"></component> </div> ...
0
votes
1answer
38 views

in angularjs, how do I access a formController?

when reseting the data in a form, wish to set form.setPristine(), but the formController is not yet registered in $scope. this may seem like a dumb question, but how can I find the formController? ...
0
votes
2answers
42 views

initial $broadcast from service is received in controller under <head> but not under <body>

I have a directive that reads sync data from <title> tag. Then it trigger a service which $broadcast the data to all controllers. But the controllers under <body> tag are not receiving ...
0
votes
1answer
40 views

Why ng-scope is added to javascript inline of my partial view and makes alert not working?

I'm using AngularJs with templating system. I want to add specific inline javascript script to each template adding alert box regards to the selected tab ( Home | List | Settings ) Html renders : ...
3
votes
2answers
43 views

Can an angular directive pass arguments to functions in expressions specified in the directive's attributes?

I have a form directive that uses a specified callback attribute with an isolate scope: scope: { callback: '&' } It sits inside an ng-repeat so the expression I pass in includes the id of the ...
0
votes
0answers
31 views

How to get the rendered html by AngularJS?

how to get the html rendered inside a div, after it is rendered and put it inside the scope of controller ? I am new to angular and though i know the basics of directives i cant seem to get the ...
0
votes
1answer
53 views

Angularjs Directive - Isolated scope value is undefined

I am a newbie in angularjs. I am little confused about isolated scope in directives. I have the following code, HTML <!doctype html> <html ng-app="myApp"> <body ...
1
vote
1answer
22 views

in angularjs, how do you get a `select` to refresh when the array for ng-options changes?

have an select based on any array. the elements in the array may change. how do I get the angular controller to refresh the array? module.js var langMod = angular.module('langMod', []); ...
0
votes
1answer
28 views

What is event.preventDefault preventing despite the event?

One goal of my main controller is to prevent users from going to urls of other users. That works perfectly fine with listening on $locationChangeStart and using its events preventDefault method. ...
0
votes
0answers
6 views

$httpBackend prevents normal angular routing; how do I configure $httpBackend to allow normal routing behavior?

I need to load up $httpBackend in order to mock out $http server calls (which return JSON). I've defined my own mocks, but when I load up my angular app with $httpBackend and my own mocks, I get an ...
1
vote
1answer
39 views

in angularjs, options for select in different controller - how to refresh?

have two different controllers, one for language, langCntl, and one for words, wordCntl. in the wordCntl record there is an attribute called ln. ln is displayed in the form using ng-select, with ...
0
votes
1answer
25 views

Angularjs directive clicking elements

Hi I was wondering when I have a list of elements from a ng-repeat, how I can allow the user to click one of the list and make it highlight via .css(). Then if the user clicks another element, the ...
1
vote
2answers
65 views

Angularjs isolates scope directive with ng-repeat

I'm trying to use directive on ng-repeat items each with an isolate scope but it isn't working. I'm looping through each item and coloring it red with the inboxuser-select directive. However, when I ...
1
vote
1answer
49 views

How can I find where an AngularJS scope visible in Batarang came from?

I am looking at my angular app in Batarang and one of the scopes has some values that I don't recognize. How can I find out what created that scope? I've already tried searching the DOM for the class ...
0
votes
1answer
33 views

Need help getting Scope Values for X,Y Coordinates from an AngularJS Directive for GAE Image Crop Tool

Trying to build a photo cropping interface tool for GAE with AngularJS. GAE accepts data in this form, crop(left_x, top_y, right_x, bottom_y) ...
0
votes
1answer
42 views

Calling Javascript within ng-if

I have some legacy jQuery code. It's a big chunk of code, so I would prefer to port it a little while later. To use it, I call $('#legacyId').legacyFunction(). Here's the deal, though. I have an ...
0
votes
1answer
19 views

Custom directive`s scope doesn't pass to child directive

Sorry if I duplicate existing post, but I search SO on the subject and couldn't find description for my case. I got a custom directive (carousel) that contain inner directives (slides) Carousel ...
0
votes
0answers
32 views

Angular: Updating directive during request

I'm trying to make a loading bar, almost similar to the one on Google +. When an action is running, I would like my progress bar to update itself, but it only updates at the start of the request and ...
0
votes
3answers
52 views

How to bind directive model to async service data

I'm trying to do simple thing - bind directive's model to service's data. And all right before service's data loads async (by $timeout or $http request), it simply does not update directive's model. ...
1
vote
1answer
43 views

Angularjs controller syntax

I am new in Angularjs javascript. Tell me what is difference between below code:- app.controller("firstController", ['$scope', '$modal', '$log', 'HttpService', 'FisrtSharedService', ...
0
votes
1answer
28 views

Angular assigns value “two way”, bug?

In my html head I have an array. This is because I render it with a Django template and it's convenient. <script type="text/javascript"> foo = ["Python", "Marketing", "Start-ups", "business"] ...
0
votes
1answer
22 views

Updating parent.parent scope

I have a problem. I'm iterating array ngRepeat = a in arrA and in this iteration I have nested ngRepeat b in arrB. And on selecting b a have to update a with data from a. Is there proper way to do ...
0
votes
2answers
57 views

Data binding doesn't work in a specific case (AngularJS)

Here is my problem : When I click on the button after having modified my model "urlservicerest", my property "$scope.urlservicerest" stays initialized to "hello". I tried to update data with ...
0
votes
0answers
41 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+" } ], ...
0
votes
1answer
24 views

order item in ngrepeat follow property of item

How can I order the post to top-down structure (the post which has highest likes number will be first and the last is the post which lowest likes number). To do that I set oderBy:likes.length but it ...
0
votes
1answer
30 views

Directive: I bound isolate scope (“=”) to template ngModel, but input won't update on controller

What I'm trying to do is put the isolate scope 'pointers' directly onto the ngModel within the template. What I expected was for the scope variables to update automatically on the parent controller. ...
0
votes
2answers
63 views

AngularJS Data service vs $rootScope events

Can you please explain the use use of data services vs the use of $rootScope events. I have a list of say branches which provides edit functionality. On click of edit button I am broadcasting an ...
0
votes
2answers
106 views

AngularJS Directive using Compile cannot access child elements

My intent was to create a directive that could rearrange (not reorder) its child elements into a Bootstrap CSS Grid, but I am having a lot of difficulty getting access to the child elements. I've ...

15 30 50 per page