0
votes
0answers
18 views

update scope in directive after async call

I have a directive used to simulate a loading pane: var loadingModule = angular.module('loading', []); loadingModule.constant('MODULE_VERSION', '1.0.0'); ...
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 ...
0
votes
1answer
16 views

Angular drop-down and text input in same field and Angular data-binding

Is it possible to create a field input in angularjs, which can take value from dropdown and also has custom input. So the following two input options should be one, and user can choose value from ...
0
votes
0answers
18 views

why contend show multiple time in angular while using ajax call?

I have two problem in my demo .I am making a pop over .I should open on icon click(here is used star icon).when i click star icon I am able to see pop up screen as I want but problem is that when I ...
0
votes
2answers
29 views

Change the dimensions of the root element of an AngularJS directive

I have an AngularJS directive which is used in Element mode i.e. it is used as a custom tag in HTML. angular .module('myModule') .directive('myDirective', function() { return { ...
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
2answers
20 views

Tell child directive to act after a parent directive has done DOM actions?

Let's say we have some nested directives: <big-poppa> <baby-bird></baby-bird> </big-poppa> And let's say that big-poppa wants to create a component that all of his ...
-2
votes
2answers
19 views

from Date I just want to subtract 1 day in javascript/angularjs

with the help of new Date() how i can achieve this. my code : var temp =new Date("October 13, 2014 22:34:17"); console.log(new Date(temp-1)); requirement: before: Aug 4, 2014 11:59pm (EDT) after: ...
0
votes
0answers
32 views

Dynamic Templates using Angular JS

I'm following this Blog post < http://onehungrymind.com/angularjs-dynamic-templates/> to understand the loading of dynamic templates using Angular JS in the same view. Now my requirement is ...
0
votes
2answers
23 views

Clear the ng-model asssociated to textarea inside Angular Bootstrap UI tabset form an outside button

I have used angular bootstrap ui tabset to create two tabs and both of the tabs have textareas associated with a ng-model, i have a clear button outside the tabset and i want to clear the ng-model of ...
1
vote
1answer
33 views

why pop over display all time in angular?

I make a pop over using directive .But my popover display all time when i generate row dynamically .I need to show popover or tool only on icon click ? Now it is display without click and also ...
0
votes
1answer
28 views

Use HTML in Angular Directive parameter

I'm trying to pass html code to an angular directive as a parameter. Is this possible? Here's the directive in the html. Inside the directive, the <br><br> comes out in plain text. ...
0
votes
0answers
37 views

Is there a way get width and height of child element in a directive in Angularjs

I am using an angularjs directive with a template to append divs to element. CSS automatically styles its width using max width. How do I find this width for further processing? I tried: for(var ...
0
votes
1answer
22 views

how to create star icon in each row angular?

I am trying to make star icon in each row.I am generating the row dynamically but I am able to generate rows but my star icon is visible on upper of top row why ..I need to show start icon in each row ...
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 = ...
-1
votes
0answers
44 views

Passing function into angular directive

I try to pass a function into my angular directive. The function should be declared inside the view and not part of the controller. <div myDirective myFunction="function(foo) { return foo.bar ...
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] ...
0
votes
0answers
29 views

Confusion about angular $digest cycle

I'm creating a directive that will allow you to style a "dropdown" anyway you like. Basically what I'm doing is hiding the actual select element and providing a div with a ul that will have all the ...
0
votes
1answer
39 views

AngularJS directives: Substituting attribute values directly into template

I've been trying to develop an AngularJS directive that outputs a labelled form-field. I'd like to be able to use a tag like the following: <simpleTextField bind="user.email" label="Email" ...
-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
0answers
24 views

AngularJS directive with transclude from a promise ($resource)

I am completely new to Angular and have been attempting to make a simple blog to get to know some of the features. The design I have is a JSON API for posts, which include a post title, created and ...
0
votes
0answers
17 views

how to browse multiple images in angular js?

I am trying to browse multiple image and display image on screen .I googled it found dropzone.js.from this link http://www.dropzonejs.com/ .Now I am using this with angular.can we I import that file ...
0
votes
2answers
36 views

how to read json file in angular?

can you please tell how to how to read json file.I am able to read json file using controller .but there is way to read file from factory .When I use factory am getting null contend..why ? ...
0
votes
2answers
23 views

angular js directive attribute and controller scope

I would like to have a directive which creates a div as title and a ul list under it. I want the title to be set from attribute and a the list by a controller. Here is a fiddle of my code HTML: ...
1
vote
1answer
30 views

how to send parameter value in second view in angular?

can you please tell me how to display the value of parameter on second view ?Actually I make a form in which there is two field : name and class .when user press(after filling fields) add it generate ...
0
votes
1answer
27 views

Text Area linked with drop down

I have a drop down linked to a text area, so that when a choice is selected from the drop down the textarea automatically populates from the same model. A working version can be seen here: JSFiddle ...
0
votes
2answers
27 views

Dynamically add ng-click in dropdown directive

I'm trying to dynamically add a ng-click to a bunch of li's that get dynamically created inside of a directive. The idea is to hide the select element and overlay it with a custom div with a ul and ...
0
votes
2answers
37 views

Data Binding to convert mm to ft and inches or vice versa using Angularjs and ng-model

I want to convert lenghts from mm to ft and inches or vice versa. User can input either mm or ft&in.The case is I always want to save data in mm to database but use angular to see it in both ...
0
votes
1answer
16 views

How do I customize directive template based on attribute in Angular?

I'm trying to make an cell into an input if it's set to editable by an column definition variable but I'm not very successful. This is my directive app.directive('bsCell', function() { return { ...
3
votes
3answers
72 views

AngularJS - Directives in a template

I'm trying to find the best approach for dynamically creating the sub-contents of an element created using a directive. To give a simple example, say I have directive that say creates a basic div ...
0
votes
1answer
27 views

AngularJS Directives: Inserting Attribute values in template

I am fairly new to AngularJS, and I have the following problem. I have an HTML Element: <div class="hn-multi-select" array-of-strings="testArray"> </div> and a Directive: ...
0
votes
0answers
36 views

AngularJS directive with template having ng-repeat and ng-bind-html

I have created a directive with template having ng-repeat and ng-bind-html as below app.directive('customField', function ($compile) { var getTemplate = function (customType) { return '<span ...
0
votes
2answers
26 views

AngularJS specifying multiple values for attribute of custom directive

I am creating a directive <chart> in AngularJS. I want to add a attributes x-series and y-series to it. A requirement is that these attributes should take multiple parameters like ...
0
votes
1answer
31 views

Set an element's attribute text/value through an angular directive?

How do I set the text of an attr? Trying to set the values of meta tags description through it's content attr. <title update-title></title> <meta name="description" ...
0
votes
0answers
18 views

AngularJS: Zeus Slider Doesn't activate after first visit to page

I have a ZeusSlider on a site I'm doing for a guy in AngularJS, it loads the first time I visit the homepage, but not if I go back to the home page. The script is firing, so I'm not sure why the ...
0
votes
1answer
12 views

Isolated scope member updated within link/controller but is undefined when passed to controller

I have the following code: HTML: <body ng-controller="MainCtrl"> <main-dir data="data" on-update-map="updateMap(datalength)"></main-dir> </body> JS: ...
0
votes
0answers
10 views

What are the exceptions to depth-first directive linking?

So for the most part, I find that AngularJS has a depth first approach to directive linking. For example, if we had the following markup: <custom-outer> <custom-inner> ...
0
votes
1answer
11 views

Problems with ng-repeat and ajax-loaded content in directive

I'm creating some directive that wraps up jCarousel plugin. But content for it loading dynamically via ajax. So here are examples of my code: Calling directive in HTML: <div class="jcarousel" ...
0
votes
1answer
23 views

Disable text selection with Angular directive

I am learning JavaScript and AngularJS. I want to disable text selection with Angular Directive. I have a JavaScript code for that function: function clearSelection() { if(document.selection ...
0
votes
2answers
48 views

how to make ng-model value set by ui-select value

I am currently using angular-ui/ui-select in my project. I am able to bind the value of the ui-select to an object without issue, however it is binding the entire item that is being iterated over. I ...
-1
votes
1answer
27 views

Angular directive: watching an expression consisting of variable and function

everyone! Thanks in advance! I have the following problem: I want to watch an input field's attribute, which at the same time is my directive's name, to focus and select the value when a) the area ...
0
votes
2answers
20 views

Adding or duplicating directive dynamically does not get variable values from parent scope

I'm trying to figure out how I can dynamically duplicate my directive and at the same time maintain the variables from my parent scope. here's a fiddle to make it clearer ...
0
votes
0answers
36 views

Ng-Grid: Cannot read property 'on' of null

I am working on developing an angular.js directive which is simply a JQuery dialog box with a grid within it. Directive Template: <div class="datasetsGrid" ng-grid="gridOptions"></div> ...
1
vote
0answers
27 views

How to add field in ng-form, if this field is located out of ng-form (AngularJS)

I have: <ng-form name="myForm"> <input...> <input...> <input...> </ng-form> <special-field ng-model="myField" /> and I need to add 'special-field' in ...
0
votes
1answer
24 views

Asterisks in input field indicating length with angularjs

I'm using angularjs for a app I'm working on. I need an input field with a specific length of characters a user has to enter. To indicate how long the input should be, I would like to have an input ...
0
votes
0answers
17 views

TemplateUrl not working in Angular

I'm experimenting with Angular, and I just don't understand why my directive won't work on my computer. When I use 'template' in my directive, I get the result I want, but when I do the 'templateUrl' ...
-1
votes
1answer
23 views

Shift click to add value to object without using angular directive

In HTML file: ... <ul> <li><a href="#" ng-click="addFruit('Apple')">Apple</a></li> <li><a href="#" ...