1
vote
0answers
19 views

wrapping inputs in directives in angular

I had the idea to wrap inputs into custom directives to guarantee a consistent look and behavior through out my site. I also want to wrap bootstrap ui's datepicker and dropdown. Also, the directive ...
0
votes
0answers
26 views

Angular directive doesn't fire change event in ngModel

I created a directive for input elements which creates a custom select2 dropdown. After selecting an element, the original input field (which is used to filter data via the ngModel) is filled with the ...
0
votes
1answer
21 views

Parse directive when it is set inside of a ng-repeat loop

Wondering if it is possible to make a directive inside of ng-repeat <div data-ng-repeat="item in items" data-{{item.type}}="item"> </div> such that the result is <div ...
0
votes
0answers
8 views

Angular ui typeahead from an array of objects - how to get the select value

I'm using typeahead angular bootstrap which is a very neat directive, but I'm encountering a difficulty to get the select value when using it with an array of objects (needed for a custom template ). ...
0
votes
2answers
35 views

How can I add a listener to an Angular directive?

I have a directive that builds a Google chart. I would like to trigger an event handler on my controller's scope when the directive receives an event from the chart. Sample: ...
0
votes
0answers
9 views

ui-codemirror placed within custom directives fails without an error

I am trying to use ui-codemirror angular directive from code mirror angular library and the use case is that I have to place it within a custom directive . But when I place it within a custom ...
0
votes
3answers
38 views

callback from directive, work with updated object?

See my plunkr, with angular 1.0.8. I'd like to work with the updated object in my controller method (fired by the directive callback). This is the current situation: Is there a way to work on the ...
0
votes
1answer
35 views

Directive and more

I have developed a web application using Angular.js (It's my first). The application features a collection of interactive graphics (seat maps); so I created a module to handle the Raphael stuff, ...
1
vote
1answer
21 views

How to finish compiling element, if directive sets terminal: true?

Code is here. I'm trying to create a directive that re-arranges it's child elements. I can't use a simple ng-transclude because I want to put some child elements in different places within the ...
0
votes
0answers
16 views

AngularJs add animation to ng-swipe

i'm facing a real challenge here :) Adding animation to ng-swipe operation, i have line that i'm swapping, i want it to slide-left or slide-right then the new line will be appear instead, currently it ...
6
votes
1answer
59 views

When Angular directive's name really matters

I've just come across a strange behavior from Angular: Here's the scenario: In a registration form, I want to check for email uniqueness (through an http call to server). Thus, I created a directive ...
4
votes
2answers
69 views

set variable in $watch sometimes fails?

Using Angular 1.0.7: I've a directive which is meant to display a styled checkbox. See plunkr here. Sometimes (and not always) my watcher doesnt update one of my scope's variable see: Here is a ...
0
votes
1answer
42 views

Basic AngularJS Directive

I'm new to AngularJS. I'm trying to create my first directive. I'm having some challenges. In an attempt to "learn-by-doing", I decided to create a custom HTML element via a directive. My element will ...
0
votes
1answer
18 views

angularjs ng-include manage dom from the controller

Is there a way to manage the dom using ng-include (for instance show the p with color:red) I've tried with <body> <div ng-controller="MyCtrl"> <div ...
0
votes
1answer
38 views

Angular JS Missing Required Controller error: Controller 'ngModel', required by directive can't be found

I have this directive: directive('myDirective', function() { return { restrict: 'EA', scope: { params: '=ngModel' }, ...
2
votes
1answer
24 views

call a function on the top most directive while passing a parameter using angularJS

So the story is like this: I have a controller (full.js) which is attached to a view (full.html). The full controller is injecting a directive (person.js / person.html) into the full.html view, ...
0
votes
3answers
30 views

Angular $watch does not any fire event in my directive

i try to update an elements content depending on the attribute value of my custom directive. the code below performs well but only once on site-load. dynamic updates on the attribute value do not fire ...
0
votes
1answer
18 views

Rendering directives within $sce.trustAsHtml

I've included a Plunker here: http://plnkr.co/edit/4vqV8toHo0vNjtfICtzI?p=preview I'm trying to add a button to the DOM and when clicked should execute the function bound to it. In this case it ...
1
vote
2answers
40 views

Angular - Correct way to modify DOM elements in a Directive?

I have a directive, powerEntry, with varying CSS classes I'd like to add/remove based on model state. Currently, I have a link function, with some logic like this: Script.JS if ...
0
votes
1answer
31 views

Ensure double binding sync

I've the following setup with Angular 1.0.7: I've a directive which is mean to display styled checkbox. See plunkr here. All must toggle Foo and Bar if Foo and Bar are truthy, All should be ...
1
vote
2answers
35 views

How to properly transclude child elements in custom directive?

Here's some code : link I'm trying to create a directive that wraps its children in some boilerplate. But if the children have ng-if controlling their appearance, the "transclusion" doesn't work. ...
0
votes
0answers
17 views

media player object from directive

I'm trying to make accessible a flowplayer media player using a directive. so that parent controllers can broadcast events and then the player just responds to those events using listeners. the ...
0
votes
1answer
39 views

How do I achieve same effect without using attribute on $watch

I do not understand the example given here http://docs.angularjs.org/guide/directive. It is a timer that updates datetime every second. angular.module('docsTimeDirective', []) ...
2
votes
3answers
40 views

Angularjs - seperating directive files, but staying on the same module

I'm trying to seperate a directive to another file, without having to declare a new module - not doing: angular.module('myapp.newmodule',[]).directive but just : ...
-1
votes
0answers
11 views

ui-router nested vies dosent work's properly [on hold]

ui router dosent load my html page at first, its look's ok but it dosent work's thx for any help main.config(function($stateProvider, $urlRouterProvider){ // For any unmatched url, send to ...
5
votes
3answers
38 views

Data from directive not displaying within ng-repeat

I have broken this problem down into it's simplest form. Basically I have a directive that, for the demo, doesn't yet really do anything. I have a div with the directive as an attribute. The values ...
1
vote
2answers
72 views

Nested “E” directives - Multiple directives […] asking for new/isolated scope

Problem nesting isolated scope directives. Hi, I want to nest two "E" isolated scoped directives, like in this fiddle. (To actually reproduce the problem, you need to uncomment the <lw> ...
0
votes
1answer
24 views

Angularjs call synchronization

I am using angularjs get method to get array of feeds from server. here is my controller code. $scope.feeds = new Array(); $scope.feeds = FeedService.getFeeds(); console.debug("in controller ...
0
votes
1answer
18 views

Ng-init via function

As you know, it is possible to initialize objects as follows: <div ng-init="friends = [{name:'John', phone:'555-1276'}, {name:'Mary', phone:'800-BIG-MARY'}, ...
2
votes
1answer
28 views

angularjs text area character counter

Hi I have a characeter counter for a text area. My problem is that it doesn't count spaces or linebreaks. How do I make it so that it does so? <div class="controls"> <textarea ...
0
votes
0answers
38 views

angularjs how to find img element height and width

Hi I'm trying to find an image element's height and width in order to resize it. However everytime I use elem.height() or elem.width() I get 0? html <div> <img ...
0
votes
1answer
36 views

How to add css class with it's value in Directive?

I have a AngularJS Directive that uses jQuery DatePicker plugin. I would like to use only months and years from DatePicker. It is possible when writing following css style into html page before input ...
0
votes
0answers
17 views

Isolated scopes for multiple dialogs in AngularJS

I have a dialog box where i display a list of results. I open the dialog box like this: var dialog = $modal.open({ windowClass: "leaf-data in", ...
0
votes
0answers
28 views

Using foundation's dropdowns within angular ng-repeat

I want to display a dropdown within a table shown using ng-repeat. The dropdown is built using Foundation's dropdown.js stuff. <tr ng-repeat="lead in leads | filter:filterText> <td> ...
0
votes
1answer
18 views

how to inject my main.html to my index.php div by angularjs injector and compile

html file at my front end and i need to inject it to my index.php div #container with angularjs injector and compile i'm little new with angular may somebody help ? at first i tried to do it via ...
0
votes
1answer
25 views

How to stop propagation of & functions into nested directives

here I got one ctrl controllers.ctrl = function($scope){ $scope.trData = [ {name : 'elem1',children : []}, {name : 'elem2',children : [{name : 'elem3',children : []}] } }; ...
2
votes
1answer
46 views

How does a user style an Element Directive in AngularJS without knowing how it composes?

Firstly, sorry for my poor English. I'm learning AngularJS recently and I found that many of AngularJS's concept are very advanced especially the Directive. It's much like the Shadow DOM or Web ...
0
votes
2answers
17 views

How does angularjs get version number from this directive

How does angularjs get version number from this directive ...... angular.module('myApp.directives', []). directive('appVersion', ['version', function(version) { return function(scope, elm, ...
0
votes
2answers
30 views

How to change marker option in angularGM

I'm using http://angulargm.herokuapp.com/documentation/angulargm-0.3.1/api/angulargm.directive:gmMarkers directive to make a google map with markers with angularjs. I want to be able to change ...
1
vote
2answers
41 views

angularjs ng-repeat doesn't process linebreaks

Hi I'm building a chatapp in angularjs and my autoscroll scrolls all the way down to the bottom of the chat box like it should when there are no linebreaks in the message. However, when there are ...
0
votes
0answers
23 views

Angular in Google Maps InfoWindow

I may be asking the same question as Similar q, but I'm not sure! Basically I have code to add markers to a Google map. Then an infowindow displays. How can I put a form in here that has elements ...
0
votes
1answer
38 views

AngularJS - Creating a directive that is the opposite of ng-required

I am trying to create a directive that will add attributes based on the results of an expression. I created a directive called blank that ensures that a field is empty. I only want this directive to ...
0
votes
1answer
46 views

Enter animation not playing in Angular

I'm wondering how could I animate an element when the angular app is starting. Indeed, I see (I'm maybe doing something wrong) that the animation module is not triggering the "enter" event the first ...
1
vote
1answer
33 views

Angularjs directive : accessing sibling elements in link function

I've googled a lot to find an answer to a question which seems fundamental to me, but surprisingly with no success. The official doc left me without answers too. So the simple question is : how to ...
0
votes
1answer
21 views

Angular removing / from strings within Directive - seems to butcher html

I'm having an issue (just learning Angular) with a string having any / removed and replaced with ="". I have a directive that takes it's element and then wraps it with a div and provides some styling ...
1
vote
0answers
28 views

Animating ngRepeat

I am building a carousel by shifting an element from the start of an array then pushing it back on to the end making the carousel advance; and popping an element off the end of an array and unshifting ...
1
vote
1answer
35 views

Custom validation - “blank” directive

I am creating a validation directive that is pretty much the opposite of required. I want to make sure a textarea is cleared before the user can save. I was able to set the form's $invalid flag. I ...
2
votes
1answer
27 views

Wrapping an image with a div in AngularJS

So just starting to sit down and play with AngularJs. I would like to wrap an image with a <div> and have reached a (very early) point where I have little idea what I am actually doing. My ...
0
votes
1answer
45 views

Angular directive handling of data using $parse and with bindings in the template

A plunker for this question is at http://plnkr.co/edit/CfIryhwmlpme1ZSfnEom?p=preview I need help with various issues here: The first is that the plunker isn't exactly working as I expect...why? ...
0
votes
0answers
24 views

Submitting a form within Karma process => Some of your tests did a full page reload

In one angular directive, I have this code: $('[name=' + formName + ']').bind('submit', function () { validate(); }); In the beforeEach clause of a Karma test, I have this code: bootstrapInput ...

15 30 50 per page