Tagged Questions
0
votes
0answers
9 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">
...
1
vote
0answers
34 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
16 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
20 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
26 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
38 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
20 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
14 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
47 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
49 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
62 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
32 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
37 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
0answers
29 views
Why ng-scope is added to each line of my partial view and makes javascript file unrunable?
I'm using AngularJs with Node.js Jade templating system and Express as a server.
I want to add specific javascript file into my template (map.js) but what I don't understand is that into generated ...
3
votes
2answers
38 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
30 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
45 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
25 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
23 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
62 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
40 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
30 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
34 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
49 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
38 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
25 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
21 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
54 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
39 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
22 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
27 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
59 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
100 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 ...
0
votes
1answer
29 views
angularJS: Why does binding to scope inside a directive result in lost content of ng-repeat?
I have this fairly simple HTML structure:
<div ng-controller="MyCtrl">
<div dir1="xy"><div>dir1static</div><div ng-repeat="item in ...
0
votes
1answer
62 views
How do you submit a form in AngularJS?
I have a simple form, you select a color and input a quantity. When you click the submit button, I want to replace index.html partial with the submitted.html partial and work with the information ...
0
votes
1answer
24 views
AngularJS: how to know when the $compile has finished?
http://plnkr.co/edit/GRVZl35D1cuWz1kzXZfF?p=preview
In the custom fancybox (aka lightbox, a dialog) I show contents with interpolated values.
in the service, in the "open" fancybox method, i do
...
2
votes
2answers
81 views
Handling data response from $resource in angular js
I have a RESTful application with Laravel 4 and Angular JS.
In my Laravel Controller,
public function index() {
$careers = Career::paginate( $limit = 10 );
return Response::json(array(
...
0
votes
1answer
37 views
Angularjs query does not work
Hello friends my english is poor. i'm sorry
How to use it
ng-click="bak = {{maclar.macid}}"
<div><span ng-class="{class:bak == true}" ng-click="bak = {{maclar.macid}}" ...
0
votes
1answer
42 views
Outer AngularJS directive doesn't build inner directive correctly
Using AngularJS 1.0.8, I'm trying to create some reusable directives to create a situation where a web developer can code a single "top-level" directive with a number of attributes, and this ...
1
vote
2answers
48 views
In AngularJs, how do I identify a specific scope within a controller that is used multiple times on a page?
I have an application that uses multiple tabs with a grid in each tab. I have multiple pages using this same configuration.
I have a single controller that works for all grids. I would like to ...
0
votes
0answers
55 views
Setting Model in AngularJS Control Not Updating View (something…)
I am experiencing issues with updating values in my AngularJS controller and having them properly reflecting in my model.
I have the following form in my view:
<form name="formSignIn" ...
0
votes
1answer
36 views
Accessing scope within directive
I have a controller which is charge of getting event json data and if there is data, update the dom with data, else update dom with error message:
//Controller.js
myApp.controller('EventsCtrl', ...
1
vote
3answers
48 views
Angular ng-repeat not loading
I have had this working in the past, I have moved the site about on localhost and now I can't seem to get ng-repeat to display results. Any ideas?
App:
var app = angular.module('Search', ...
5
votes
1answer
66 views
AngularJS: How to correctly work with Directives, Scopes and Bindings to avoid memory leaks?
I'm trying to find a solution for an AngularJS app memory leak. Because I'm new to the AngularJS world I don't really know where to start and where to correct and optimize my code.
I'm trying to give ...