0
votes
0answers
5 views

Dynamic templateUrl in directive

I have the following directive: Directives.js module.directive('vdGuarantees', function () { return { restrict: 'A', template: '<div ng-include="contentUrl"></div>', ...
0
votes
1answer
15 views

Angularjs ngModel directives in input controls

I'm new to angularjs and besides working on a project using angularjs I'm learning it as well. The query which I have, is relevant to the following code:- <html ng-app> <head> ...
0
votes
1answer
11 views

Update $scope when contenteditable Elements Change with Angular.js

I am new to Angular.js and have tried to follow several tutorials to learn how to two-way bind contenteditable elements in an ng-repeat. I am using a shared 'store' between controllers, e.g. ...
0
votes
1answer
8 views

Trigger $scope.$watch when static attribute changes

I have an element with a custom directive on it as so. <div my-directive data-progress="0"></div> my-directive is as follows. return { scope: { progress: '@' } ...
-1
votes
0answers
23 views

Angular directive inside directive

I am creating angular directive whose template need to have another directive. How to achieve it. Following code is my attempt to achieve this, which is not working. app.directive('wrongIfTrue', ...
0
votes
3answers
21 views

Dynamically specify the controller to use in an Angular directive

I am looking to specify the controller that a directive should use via an attribute on the element - i.e. dynamically: HTML <div data-mydirective data-ctrl="DynController"></div> ...
0
votes
1answer
15 views

Calling service method from a directive template

Let's say I have a directive: <component> <img ng-src='{{something}}' /> </component> defined as: app.directive("component", function() { return { scope: {}, ...
1
vote
2answers
29 views

why header come down when constant or fixed button add .?

I have one button which should be remain contant or fixed in same position in all views .But when I added a view , its header comes down below the button why ? when I remove this ...
0
votes
2answers
19 views

Adding new form inputs continuously

I currently have a form where an individual can add firstname and lastname via two input fields. In some scenarios they may want to add more than one so I want to provide button/bit of text below ...
1
vote
1answer
24 views

Accessing directive scope from a separate controller

Let's say i have a <lightbox> directive in AngularJS. The lighbox has two params: title and image_source, which in turn are referenced in its HTML with {{title}} and {{image_source}}. Because I ...
2
votes
1answer
51 views

why css is not apply on list using JQM in angular

can you please tell me why my list is not display . I used this https://github.com/angular-widgets/angular-jqm here is the documenetation ...
0
votes
1answer
22 views

How to deal with extra markup used for angular directives?

I have two directives: appButtonGroup and appGroupedButton. My css expects th <app-grouped-button> elements to be direct descendants of <app-button-group>, so they can be laid out as ...
1
vote
1answer
21 views

Directive does not have access to controller function (AngularJS)

When I declare a directive to use that accesses a controller function, it cannot find the controller. Here is my directive declared in app.js: app.directive("delete", function() { return { ...
0
votes
1answer
21 views

AngularJS, inconsistencies when assigning versus updating scope within the transcluded content of a directive's isolated scope

JSBin Example: http://jsbin.com/yuyetakonowu/1/edit?html,js,output Summary: I have two directive's (myParentDirective and myChildDirective). myParentDirective transcludes myChildDirective content. I ...
1
vote
1answer
30 views

ng-repeat and ng-switch doesn't work on same element

JS $scope.mode = "test" $scope.array = ['test1', 'test2', 'test3'] HTML <div ng-switch on="mode"> <div ng-repeat="item in array" ng-switch-when="test"> Test {{item}} ...
0
votes
2answers
22 views

AngularJS replace complex select directive

I've implemented a select dropdown for filtering through a list of items. I'm looking to create a directive that will hide the select dropdown and replace it with a custom dropdown using the same ...
0
votes
0answers
14 views

ng-minlength in directive not populated when invalid

I'm creating an input directive that encapsulates a label, and some error messaging but I'm getting stuck with ng-minlength and ng-maxlength. The issue is that they don't populate the model value ...
0
votes
0answers
19 views

Focus cursor AFTER placeholder text, angular

I've used one of the many angular directive based solutions for this, it would be a hassle to type out all of it. In fact, the updated answer given by Shimon on this question is exactly what I have ...
0
votes
1answer
10 views

Forms-angular, how a custom directive field can affect the $pristine state of the full record?

Question related to forms-angular project. Preamble The default formInput directive of forms-angular can be override by a custom directive by specifying the form.directive property in an extended ...
0
votes
1answer
11 views

ngTransclude not wrapping content at all

I have a custom angular directive that goes in several of my views in angularjs. The directive is set to transclude but none of the wrapped content shows up. app.directive('card', [function() { ...
0
votes
0answers
15 views

Animation in angular js slide animation of div?

Hi can you please tell me how we slide div when user click tab .I make demo in juerry Moible (fiddle http://jsfiddle.net/ezanker/o9foej5L/1/ ) in which I have three tab and using the tab it show ...
0
votes
0answers
24 views

Making sure a directive runs before all other directives

Is there a way that I can make sure that a specific directive runs before all other custom directives? I am using a directive to dynamically load CSS files in order to better accommodate my ...
3
votes
0answers
21 views

angular scrollstart and scrollstop don't fire in directive, scroll does

I have a directive as below: .directive('scrollPosition', function($window) { return { scope: { scroll: '=scrollPosition' }, link: function(scope, element, attrs) { var ...
0
votes
0answers
17 views

validation with dynamic name in ng-repeat

Im currently having an issue where I want to create multiple form inputs with validation. The form elements I want to create will be up to 100 duplicated fields. To do this I have used ng-repeat as ...
0
votes
1answer
20 views

How to resolve parent/child URL in Angular JS (ngRoute)

Unable to open this path /site/recentposts when typed in browser URL , /site works okay but need to use this path /site/recentposts when typed in browser URL to open page /site/recentposts. site : ...
-1
votes
3answers
31 views

Angular two way data binding not working

Thank you all guys. I will now select one detailed answer and close this up. see the code below, it's fairly straight forward <tr ng-repeat="record in records track by record.id"> ...
0
votes
0answers
37 views

how to make tab bar in angular js with sliding effect?

how to make tab bar or navigation bar in angular with sliding effect .I am able to make in jquerry mobile .Here is my fiddle http://jsfiddle.net/ezanker/o9foej5L/1/ when I used same thing in angular ...
0
votes
0answers
22 views

Angularjs: ngView not rendering view in jade

I'm new to angularjs and working on project where is need to use ngView with jade for rendering views. I have also searched through the previous questions asked about ngView here but couldn't find ...
1
vote
1answer
28 views

angular: How to change the data type using $formatters and $parsers?

Using ngModel.$formatters and ngModel.$parsers i'm trying to create a directive to change the data-type from model to view and vice versa. The problem is when i use <input type="number"> In ...
0
votes
0answers
25 views

Can I apply an AngularJS directive to an element via JavaScript instead of HTML?

Because the HTML5 date field is not supported in most major browsers, I'm using the UI-Bootstrap Datepicker directive to add date pickers to some form fields. Instead of applying the directive in the ...
2
votes
1answer
18 views

Button Disabled/enabled on check-box state with Angular

I have created a reusable directive and using it in two different forms but unable to able/disable the button in form which changes according to the check-box state in directive. I want disable the ...
0
votes
2answers
21 views

Is there a way to know the name of the model used in a directive?

Suppose I have the following directive: .directive("counter", function () { return { restrict: "E", scope:{ bindModel:'=ngModel' ...
0
votes
0answers
8 views

Angular-tree-ui JSON Data with $http

I'm currently been using the angular-tree-ui component, which is a nice little component that allows nesting of hierarchical data with drag and drop support. All has been going well until I started ...
1
vote
1answer
25 views

How to easily determine what's added/removed in a $scope.$watch?

I am tasked with wrapping a JQuery-style UI component within an Angular directive. I have completed the task but it looks rather ugly. The underlying component's API only has add and remove methods ...
0
votes
0answers
7 views

AngularJS $anchorScroll with scrollLeft

I have four images of a pdf application that I'm overlaying user inputted data on top of. I then need the users to sign the application so I implemented a directive that utilizes jSignature and ...
2
votes
1answer
38 views

Angularjs: seeing examples of directives used as controllers

I am reading this article: http://icelab.com.au/articles/an-all-in-one-directive-controller-with-angularjs/ I think it would be a better practice to use a controller with ng-template in this example, ...
1
vote
1answer
29 views

How to show validation error messages on the right side of the input field in a tooltip using angular js?

I have form which contains some fields and have validated these fields by using angular.validator. The error messages are displayed under every fields. But I want to display this error messages using ...
0
votes
2answers
30 views

How to distinguish multiple directives in the same $scope?

I actually call directive functions from controllers like this : function myControllerFunction = function () { $scope.highlight(); } highlight(), being a function in a directive. What if I had ...
1
vote
1answer
21 views

AngularJS directive not inserting values into template when using an isolated scope

Given the following directive: angular.module('news.directives', []) .directive('newsArticle', function($location, $timeout) { return { restrict: 'AE', replace: ...
1
vote
0answers
34 views

angularjs:-Append data into HTML the angular way

I am a newbie to angular js,I have a js background and was stuck into something:- I want to append data into the HTML with the help of directive. I am storing the value (ie HTML) in a string..But it ...
-1
votes
2answers
19 views

How can I take data from an external controller into a directive template?

I have a factory who provide data to a controller but when I call from the directive the data do not bind. myApp.directive('user',function(){ return{ replace:true, restrict:'E', ...
0
votes
1answer
22 views

jqueryui combo custom directive in angularjs

I was trying to create a custom directive for jQuery UI ComboBox , it should work like an autosuggestion and dropdown. Neither i am getting the look and feel nor the logic. I want to use it as it is ...
0
votes
0answers
23 views

ng-src display:none issue, src works

I have an issue in that when I scroll up my image is appended with display: none at one point (when my pageYOffest is 46) then removed, causing a flashing effect. When I replace the ng-src with src it ...
0
votes
0answers
23 views

Render directive in parent controller defined in child controller

Basically i would like to achieve something along the lines of this: <div ng-controller="ParentController as parent"> <render-page-controls></render-page-controls> <div ...
0
votes
0answers
8 views

Angular transclude ng-repeat inside directive

I have a directive that transcludes the original content, parses it, and uses the information in the original content to help build the new content. The gist of it looks like this: .directive('list', ...
1
vote
3answers
37 views

What does the ngModel directive documentation mean exactly?

I'm beginner to AngularJs but now I have used and understand how AngularJs works quite a bit. The thing which I want to ask about is the few lines in the ngModel directive documentation. These ...
0
votes
1answer
19 views

how does my-pane directive's scope get access to selected property in this example

In this official example, in section "Creating Directives that Communicate", in file my-pane.html, ng-show='selected' is used for determining whether the content is to be hidden or not. My question ...
1
vote
1answer
62 views

AngularJS ng-model not working on dynamically created input fields

I've created a dynamic templateUrl for form fields and I'm trying to attach ng-model within ng-repeat. The parent directives and form field directive all work and are generated, but when I use ...
2
votes
3answers
31 views

Angularjs input field focus event?

i use angularjs and i have created a normal input field like this: <input type="text" style="border: none" ng-model="model" > i want do the following: if someone clicks in the input field, i ...
1
vote
1answer
20 views

How to reload the background image with the same url inside directive

I want to reload the background image for a div with the same url inside directive. When my view load, I used this directive to show the image as a background to a div app.directive('backImg', ...