angular2-directives Questions
3
Solved
I have a material input control, i have restrict the special character while user enter, but when type some words in any editor and copy and paste the words with special character, which is not wor...
Stoker asked 19/7, 2018 at 17:17
4
I need to use the FileSaver.js (https://github.com/eligrey/FileSaver.js/) in my Angular2 application.
I know I can add it as a script file in main html page and it will work. But I was wondering w...
Wade asked 25/10, 2016 at 13:4
3
Since there is no template, what's the best way to listen to child elements event in a directive? Is it possible with HostListener? If not, is there any other way?
There's also this similar questi...
Griqua asked 17/11, 2016 at 15:11
2
Solved
I'm creating a custom *ngIf directive to replace content with a placeholder while it's loading. I have everything working as I want and modeled it after the *ngIf directive (https://github.com/angu...
Placida asked 1/3, 2019 at 16:35
2
I am using ng2 charts from valor software with my angular 2 app. I am not able to figure out how to customize the whole html content of the default tooltip that is displayed when hovering over a ba...
Major asked 19/2, 2017 at 15:56
4
Solved
I'm trying to create my own directive in Angular 4. But, I got this error when bind the property of class into component template.
Console error:
Unhandled Promise rejection: Template parse error...
Azral asked 31/3, 2017 at 2:9
2
I have a translate pipe, which accepts a string as key, and returns the translated string from a dictionary. The pipe looks like this:
import {Pipe, PipeTransform} from 'angular2/core';
import {Tr...
Fluker asked 31/3, 2016 at 14:45
3
With the new drag and drop feature of the @angular/cdk (I'm currently using version 7.0.0-beta.2), is it possible to cancel a drag-action?
I did not find a matching function on 'CdkDrag' which cou...
Tuttle asked 2/10, 2018 at 12:6
4
Solved
I have three buttons in a view and on page load I am displaying the first buttons content. Once a button is clicked the button becomes active but on page load the initial button is not set to activ...
Typescript asked 8/11, 2016 at 18:27
1
Solved
I am using a 3rd party library to render a widget onto the screen (Okta's SignInWidget). The way the widget is rendered is so:
this.oktaSignInWidget.renderEl(
{ el: '#widget-container' },
() =&g...
Kingcraft asked 31/12, 2018 at 18:2
3
Solved
I am trying to apply a class to an HTML element based on a click event. This works fine when setting the class property for the child component's selector from the parent component's template as ...
Ratepayer asked 24/1, 2016 at 17:53
2
Solved
Update:
Günter Zöchbauer provided a very acceptable answer that works perfectly (and thank you!). But I still have a question to check if what I am doing is the correct way of getting the result I ...
Mn asked 6/7, 2016 at 17:32
4
Solved
Has anyone gotten Mathjax working with Angular2 ?
Plunkr example created :- http://plnkr.co/edit/FLduwmtHfkCN5XPfzMsA?p=preview
From some Angular1 examples I saw it looks like a directive is nee...
Preliminaries asked 2/4, 2016 at 8:7
3
Solved
Let's say I'm writing a custom attribute directive for use on Angular2 form elements. I want to be able to use my attribute like so:
<form [formGroup]="myFormGroup">
<input type="text" [...
Headlight asked 21/3, 2017 at 19:43
2
Question:
Is it possible to use @HostBinding in such a way to add, remove, or toggle classes on a host element and not remove preexisting classes, in particular when the classes need to be dynamic...
Renzo asked 29/11, 2017 at 2:47
7
Solved
I am having trouble finding a good autocomplete component for Angular2. Just anything that I can pass a list of key-label objects to and have a nice autocomplete on an input field.
Kendo does not ...
Sonar asked 9/3, 2016 at 2:28
2
I am just playing around with @ViewChild/@ContentChild, and I was surprised to see that the @ViewChild is not working inside directive and is working fine for component.But in Directive its not wor...
Booth asked 26/5, 2017 at 15:54
4
Solved
there a some similiar threads but I couldn't find a suitable answer
for my needs. So that direct DOM access should be strictly avoided
in angular2 I'm just wondering whats best practice for this.
...
Axial asked 22/8, 2016 at 16:15
2
Solved
I'm trying to create a directive that works as a ngIf to control if the user with the correct permission is allow to see specific content, something like this:
<div [type-of-user]="load data fr...
Carpeting asked 20/4, 2017 at 11:0
3
Solved
Everywhere, it is recommended to register a service in root AppModule providers array and avoid using providers array of root AppComponent.
When should someone register a service in root AppCompon...
Coltun asked 25/8, 2017 at 8:39
1
how can i get the element in angular 2?
in case i have this in html
<ng-template #content let-c="close" let-d="dismiss">
<div class="modal-header">Header</div>
<div class="m...
Salter asked 16/5, 2017 at 7:26
3
I am using 'routerLink' to navigate my routes and it is working fine. But when I click again on the same button, I want that component will load again. But currently, it's not working in angular2.
...
Vaginectomy asked 25/8, 2017 at 5:53
4
Solved
I have a directive to initializes a jQueryUI sortable on a DOM element. The jQueryUI sortable also has a set of callback events that trigger on certain actions. For example, when you start or stop ...
Gettysburg asked 14/2, 2016 at 10:34
3
So here's the deal. I have a component thats very well written and being used in a lot of places. Now I need to use the same component, but want a different template to be rendered, based upon a co...
Geiger asked 4/6, 2016 at 20:30
3
Solved
I'd like to implement the common Angular 1.x pattern of having child directives within a parent directive in Angular 2. Here's my desired structure.
<foo>
<bar>A</bar>
<bar&...
Lauretta asked 15/1, 2016 at 0:13
© 2022 - 2024 — McMap. All rights reserved.