0
votes
2answers
14 views

Accessing the value from controller in directive when the value changes in the controller

I created this jsfiddle to illustrate my issue. http://jsfiddle.net/RmDuw/84/ HTML : <button ng-click="toggleAwesome()">My awsomw button</button> <br /> ...
0
votes
0answers
28 views

Ok to use element.addClass in angular?

Loving using angular but want to keep to the "best practices" and not get into bad habits. Currently making a desktop application which is also available on mobile devices and found the bindonce ...
1
vote
3answers
27 views

Angular does not update bound property

Fiddle HTML: <div ng-controller="MyCtrl"> <button my-event-directive>Click me</button> <div>{{secret}}</div> </div> JS: var myApp = ...
0
votes
1answer
15 views

Angular.js: Store div content in scope variable

I have an editable div and I want to store the HTML content in scope variable scope.myText: <div id="editor" contenteditable="true" ng-model="myText"> <p>HTML Text</p> ...
0
votes
2answers
14 views

Directive at angularjs and custom method/html

I have this code: <body ng-controller="testController"> <div test-directive transform="transform()"> </div> <script type="text/ng-template" ...
0
votes
3answers
29 views

why my ajax success data is not display in angular js

I am trying to call ajax and get my HTML contend .But I want to show that data on tooltip/or pop over .I am getting the data on console I don't know why it showing black data tooltip it is showing ...
0
votes
3answers
28 views

Watch element on directive

I have the next code: angular.module("Test", []) .directive("testDirective", function () { return { restrict: "A", scope: { model: "=" } link: function(scope, element) { ...
0
votes
1answer
20 views

AngularJS: ngInclude with custom scope

I have an existing directive that creates a generic wizard that will be used across my current organization. This wizard will have steps, and each step has an HTML template to be loaded as the "body" ...
1
vote
1answer
31 views

I need to put a space inside ng-true-value=“fa-li ” Angularjs

The plunker shows my list working the way I want. but I am unable to put a space between my list items. It would be ideal if ng-true-value="fa-li " read that space but it doesnt. I thought about ...
0
votes
2answers
22 views

Angular Print Checked boxes to an area

I have a list of checkboxes... when any of them are checked I want them to print in the area where I use the {{}}... If it is not checked then I want there to be no visual sign that there is anything ...
1
vote
1answer
37 views

Should angular $watch be removed when scope destroyed?

Currently working on a project where we found huge memory leaks when not clearing broadcast subscriptions off destroyed scopes. The following code has fixed this: var onFooEventBroadcast = ...
2
votes
1answer
44 views

Controller not a function, got undefined, while defining controllers globally

I am writing a sample application using angularjs. i got an error mentioned below on chrome browser. Error is Error: [ng:areq] ...
-1
votes
1answer
45 views

Query not working for me

I am using angularJs ng-resource.I have tried this angular.module('app.services', ['ngResource']) .factory('AngularIssues', function($resource){ return $resource('../test.json',{},{ ...
0
votes
2answers
19 views

Binding Input to Angular controller function

I have a shopping cart that shows the name of the flavor and quantity, then the total $ of each flavor. Then at the bottom of all the flavor, I have the calculation of the entire shopping cart. HTML: ...
0
votes
2answers
29 views

How can I get a change to the Model (from within a Directive) to update in the View? $apply?

There are a lot of questions/answers here on stackoverflow and out on google about this topic ($apply), and I feel like I have read every one and followed them, but to no avail. All my searches on ...
0
votes
2answers
14 views

How do you call a parent directive controller from a child controller (not link method)

I would like to access my parent directive from within my child. I know that if you use the require property, then the link method has the parent controller passed as a parameter, but how can i ...
0
votes
0answers
23 views

angularjs ajax call wrapped by $scope.$apply function preventing ng-click from being executed

I have and custom validation directive which triggers on change to validate user input: link: function(scope, elem, attrs) { elem.on('change', function() {$scope.$apply(function(){ ...
0
votes
1answer
21 views

Detect if a function is bounded to the scope with &

I have a directive popup that has an isolated scope with only a function binding in it: Template <popup> <div class="confirm-button" ng-show="showConfirmButton" ...
-1
votes
0answers
13 views

Change module config data from controller - AngularJS

I have implemented Session timeout using AngularJS Below is code: var user = angular.module('user', ['ui.bootstrap', 'xeditable', 'ngIdle']); user.config(function($httpProvider, ...
0
votes
1answer
12 views

Add Properties after json load

I have this json: { "info": [ { "id": 999, "products": [ { "id": 1, }, { "id": 2, } ] } ] } Info -- products -----id And my factory: AppAngular.factory('model', ...
0
votes
1answer
15 views

AngularJS nested directives, inner directive's ng-click is not firing

This is a problem I'm having in my app and I am about to reproduce it in a simple example: <div f-outer> <div f-inner dat="dat"> <a href="javascript:" ng-click="run(dat, ...
0
votes
1answer
22 views

Get the HTML output from an Angular template in javascript

I have an angular template that I would like to be able to access the processed HTML from within a javascript function. If for example the template was under a templateUrl "/scheduler/tooltip.html" ...
0
votes
1answer
37 views

how to load html in while making pop over?

I make a pop over .But I insert my pop over content in same html file.I want to load popover contend from another file and load the contend using templateURl :can we do that ? Here is my demo HTML: ...
-1
votes
0answers
19 views

How can I pass the scope from addbatch to directives?

How can I call the scope from directives? I have an addbatch controller. I'm going to pass the method this.getClientNames() to super.activate, then I have a method getClientNames, but there is an ...
2
votes
1answer
44 views

Global back/next buttons in AngularJS

I have some navigation buttons on an Angular wizard-style webapp. For cosmetic reasons they need to be removed from each partial and added to the root "index.html": <!-- Global navigation buttons ...
0
votes
0answers
20 views

Why is ng-class not working on my directive when I change a scope variable by using broadcast? [duplicate]

I have a directive which is a toggle button to change the theme of the page. The code for the directive is... app.directive('twoOptionThemeSwitch', function () { return { scope: {}, ...
0
votes
1answer
17 views

Show form using custom directive - AngularJS

I have a button with ng-click function. When I click the button, it should show the form which is coded in a templateUrl using a custom directive. Which function should I use to get the screen ...
0
votes
2answers
26 views

Angularjs - watch all directive scope attributes?

I have a "bar chart" directive in Angular that I want to re-render anytime one of its many scope attributes change. I am wondering what my options are in terms of watching the scope ... As the render ...
0
votes
1answer
37 views

Access ng-repeat $index inside directive link function to access item in collection

I've run into a wall and none of the documentation is helping thus far. I'm trying to create a directive that replaces an element with an iframe pointed to an external resource and each item in my ...
0
votes
1answer
38 views

Calling a function in a directive from a controller in Angular with isolated scope

I have a directive which is essentially just a search box with multiple parameters. In the controller, the search function requires access to a function called getOptions() which is used to get the ...
1
vote
1answer
35 views

Pass parent scope variable to a directive as an attribute

I'd like to build my own version of an Angular checkbox that uses ng-model. (Documentation here: Checkbox in Angular) I've built my button, but am not sure how to link it up to ng-model. Here's a ...
0
votes
0answers
37 views

How can JQuery AJAX requests trigger Angular ng-click directives

I am new to AngularJS so have been using a mixture of JQuery and Angular in a mobile application. I am occasionally running into a really weird bug, please bear with me as I try to explain it and feel ...
0
votes
1answer
56 views

Using multiple directives on same page

I am trying to use same directive multiple times in a page, and i know that i need to make isolated scope but i didnt managed to do it. Can someone give me some tips? This is my html: ...
0
votes
0answers
29 views

AngularJS: Execute controller function from a nested directive

I have a question regarding executing a function (defined inside a controller) from a directive, but with another directive between these two (so this directive just passes forward the function). I ...
0
votes
1answer
29 views

Angularjs custom validation directive Async call real time validation

I am using custom validation directive to validate a field in a form and the validation process includes a AJAX call to verify user information with server API. We want to validate the field as long ...
0
votes
0answers
8 views

Angular window.event in attrs.$observe

I use window.event in directive. Of course, window.event doesn't work in Firefox. attrs.$observe('value', function(value) { element.val(value); ...
0
votes
1answer
32 views

Can not chage angular $scope with ng-click

I am trying to change directive controller's $scope with ng-click. I have one simple button: <button ng-click="showEnterKeyField = !showEnterKeyField">btn {{showEnterKeyField}}</button> ...
0
votes
1answer
26 views

AngularJS - Displaying Date Data For Items Only In The Last Five Years

I have a $scope.myData object that contains a list of addresses and dates that i've own/rented, eg: Example of my data From Date 2011 To Date current From Date 2010 To Date 2011 From Date 2009 To ...
0
votes
2answers
34 views

AngularJS Dynamic Filter Configuration fail to resolve

I'm a newbie to AngularJS with some fair knowledge with KnockoutJS also. I'm trying to implement a search feature on 'products' in my ViewModel that is configurable by the end user by combining.. ...
0
votes
1answer
24 views

I have create a custom directive (dynamic form template), which is create by a object. I am not able to get form data in my controller

I have create custom directive. directive having a template file which create a custom from help with the help of a object pass by controller. I am not able to get form data in my controller. ...
0
votes
0answers
26 views

How do you access ng-model's scope value within a directive that is using transclusion?

I have an application controller that is responsible for adding users to another Model. There are two ways to add users in my application. We can add them by selecting the users themselves, or by ...
0
votes
0answers
39 views

AngularJS weird behavior in controllers

I'm trying to access my resource response inside the controller/factory but I keep getting this stupid error message! This is my factory: angularApp.factory('Pokemons', function($resource, ...
0
votes
2answers
43 views

How to manipulate isolated scope input variables?

I would like to manipulate the data sent to my directive, ie. I have a myUser directive that displays the user name and is used like this: <my-user id="25" name="John Doe"></my-user> I ...
0
votes
2answers
60 views

use of ngModel from a compiled template

I'm creating a custom directive that is applied to an input and which will generate an element after the input using the $compile service available in Angular. The directive at it's current state ...
0
votes
0answers
30 views

angularjs directive needs to run if element width, or parent width changes

I have written a directive which sets style attributes to a div if the parent div resizes, but I also need the same to happen if the actual div resizes. I am unsure how to do this. The directive code ...
1
vote
1answer
19 views

Form submit in angularJS directive

I have a custom directive(contentData) for creating a custom form in my application. which have a template file. This template file have multiple piece of data which is control by a JOSN file. I am ...
3
votes
2answers
72 views

One controller's scope blocks other scopes in Angularjs

I have a set of tabs which all have a directive in them: <div class="col-md-9 maincols" id="formEditor"> <tabset> <tab heading="New subscriber" ...
0
votes
5answers
47 views

AngularJS - ng-repeat when value starts with 'X'

I have a $scope object: "MyData": [ { "CompareCode" : "A004", "CompareMessage" : "test test test, test test test", }, { "CompareCode" : "X084", ...
0
votes
1answer
52 views

Form submit in angular directive

I have a custom directive(contentData) for creating a custom form in my application. which have a template file. This template file have multiple piece of data which is control by a JOSN file. I am ...
0
votes
3answers
47 views

ng-model is not bind with controller's $scope when I am creating a form dynamically using directive.

view code:- mydir is my custom directive <div ng-model="vdmodel" mydir="dataValue"> </div> my directive :- ...