Questions tagged [directive]

A concept of 'command' used by many programming languages and frameworks. Use this tag with a language and/or framework to indicate context. The C/C++ pre-processor is one language that relies heavily on directives. They call it "pragmas".

2065 questions
0
votes
1 answer

passing parameter to directive in Angularjs

I have the following directive: angular.module('SuperCtrl').directive('listDirective',function(){ return { restrict:'E', scope: { title:"=" }, templateUrl: '../templates/listWidget.html' }; }); I want to be able to reuse…
Matt Boyle
  • 385
  • 1
  • 6
  • 25
0
votes
0 answers

Extending Angular uibDatePickerPopup Directive to allow certain String

We have a need to use uibDatePickerPopup directive but then allow to enter certain text instead of a date. I am trying to extend the directive but I keep getting "Parser Error. The value should be a date object" error. Any help would be…
0
votes
1 answer

ChartJs Angular directive - chart[chartType] is not a function

I'm having problems getting a simple chart to work using angular. I have chart JS set up using "angular-chartjs-directive": "^1.0.0" within my bower. This gets injected correctly based on the source of my file. I then have this as my…
Darren Keen.
  • 512
  • 6
  • 10
0
votes
1 answer

why my angular form is not dirty when I have changed inputs value in my $provide.decorator?

I want extend the default inputDirective in angular.so I wrote these code: module.config(function($provide){ $provide.decorator('inputDirective',function($delegate){ var directive = $delegate[0]; var originalLink = directive.link; …
WangJi
  • 191
  • 2
  • 8
0
votes
2 answers

Two instances of same directive interfering with each other?

To pinpoint the bug I have, I created two instances of the same directive in my view : The first gets its state from containing controller,…
Nicolas
  • 1
  • 2
0
votes
1 answer

Angular2 trigger directive from component on click

I have a directive that adds box shadow to any hovered element on page but I need it to start applying the shadow after a click of a button. The problem I have, is it only applies to a single element. Here is an image of the box shadow It applies…
Juggy
  • 27
  • 2
  • 6
0
votes
1 answer

angular calling controller function in from directive controller

I have a question that should be really simple, but i cannot find the answer. I have controller a: app.controller('myController', function ($scope){ $scope.MyParentFunction = function(){ alert("it does not work.."); }; …
0
votes
1 answer

Setting focus on shopping cart line items with angularjs

I've got a modal used to display the line items in my shopping cart. In this shopping cart modal, I display each item, with a quantity input box, on separate rows. Each time a new item is added to the shopping cart, the modal opens with the most…
Stephen
  • 1,977
  • 2
  • 15
  • 19
0
votes
1 answer

Does an element has a scope in the pre link phase?

I've been told that pre link phase is executing before a scope linked to the DOM element, and post link is after the DOM element been linked. Then I did an experiment: I set a 'debugger' in pre link function, navigated to my angularjs web page, when…
Tony
  • 153
  • 1
  • 8
0
votes
1 answer

Html in AngulaJS does not change when I test with an alias controller

I have a problem in AngularJS, to test a html div with a dynamic value when I use controller's alias Here my code
{{ ctrl.detail_title }}
where crtl is the ContractController's alias. My test is …
0
votes
1 answer

I can't add ng-cnpj directive using angular-formly

Anyone know how can I add an directive on my formly object field? I have the ng-cnpj (https://github.com/gil/ng-cpf-cnpj) directive and want to add it in my cpf field on my controller. .... { key: 'cnpj', type: 'maskedInput', …
Biruel Rick
  • 776
  • 1
  • 8
  • 17
0
votes
1 answer

Angular2: Directive variable change, update element

I'm currently trying to give classes to an wrapper that contains all of my app, i usually find this handy for giving certain states like when the header is fixed, or the menu's are opened etc. So upon reading through some the docs of angular i…
LVDM
  • 444
  • 2
  • 23
0
votes
1 answer

Angular (1) directive, dynamically change ng-if state and img src

I've been trying to refactor some code, using a directive instead of the img tags. I want to dynamically change the ng-if state and the src, depending on what value I input in the directive. for right now the code looks something…
Kazordomo
  • 47
  • 1
  • 7
0
votes
1 answer

How to hide an element while using a directive?

I have made a directive in which a single template is using for three functions in a controller. The model for the fields are same. I want to hide a field if the directive is called third time.
Usman Iqbal
  • 2,379
  • 5
  • 26
  • 50
0
votes
2 answers

Why won't my Angular 2 component allow me to declare directives?

I have somehow gotten pretty far along with my Angular 2 app without ever actually learning how or when to use custom/third-party directives. Anyway, I am trying to use ng2-uploader to allow users to upload images with a form and in rc6 I have to…
Smaft
  • 142
  • 10