Use for questions about Angular 2+ directives
Questions tagged [angular2-directives]
1806 questions
0
votes
0 answers
get NgModel input element value onInit
I am trying to get the ngModel value when it is un-touched, pristine on OnInit, all I am trying to achieve is when I do a request.GET and bind that value to ngModel to catch it in the directive while is un-touched.
for example:
0
votes
1 answer
Angular2 material npm dependencies
I have the following dependencies in my package.json for npm to find and install.
"@angular/material": "2.0.0-beta.1"
"angular-material": "^1.1.1"
In order to use the latest one's what should I specify?
The reason I am looking to use this for its…

BalajiK
- 2,471
- 2
- 13
- 12
0
votes
0 answers
Ionic2 html tags not displayed in i18n string with inner html
My issue is related to the app internazionalization in Ionic2 and Angular2. I've successfully rendered a message after some investigation which includes native html tags nevertheless when I try to include ionic tags, they are not rendered.
I have an…

mannuk
- 1,259
- 5
- 21
- 43
0
votes
2 answers
Show modal pop up in Angular 2
I am trying to integrate a modal up to my page based on implementation provided here in this post
How to pass data to bootstrap modal dialog in Angular2
and working plunker solution was provided here …

Born2Code
- 127
- 1
- 4
- 19
0
votes
1 answer
Not able to use ng-model
Not able to use ng-model. I am getting this error even after importing
formsmodule in app.module.ts Below is my both the file component and module. Please correct me where I am wrong. Thanks In Advance
Promise rejection: Template parse…

Tushar
- 3
- 2
0
votes
1 answer
how to read HTML structure from string and map attribute values to local variables in angular2
I have an HTML tag retried from database which holds some attribute.
To specify with example :
I have this HTML string as :
now i want…

pritesh agrawal
- 1,155
- 8
- 16
0
votes
1 answer
Hide if array is more than 1 in angular2
I am very much upset trying with unsuccessful result.
There is an object array where inside the object there is/are a booking id/ids. Booking Id is an array inside the object. Booking Id hold 1 or more no. of booking id. I want to hide the booking…

Santosh
- 3,477
- 5
- 37
- 75
0
votes
2 answers
Angular2 single ngFor for multiple arrays
Is it possible to use multiple array's for ngFor in Angular?
*ngFor="let device of element.devices && element.zones.devices"// something like this
export interface Element {
id: string;
name: string;
zones: Zone[];
devices:…

Pratap A.K
- 4,337
- 11
- 42
- 79
0
votes
2 answers
How to add attribute to button and access it at the global level in angular 2
I want to add an attribute to a button like below
I want to add some more logic at the global level for click event, is there anyway that whenever I add a button or any…

user1188867
- 3,726
- 5
- 43
- 69
0
votes
1 answer
Angular2 | How to addClass and removeClass specifically (clicked div element to activate the className)
## Note: ##
Onclick of div I am trying to enable the class name which was clicked.
like eg: $('div[data-index='0.0']').addClass('selected'); in Jquery // addClass only to specified div which has data-index =0.0.
I dont want want it to enable…

Karthi Keyan
- 43
- 2
- 7
0
votes
1 answer
Download of Node 7.9.0 failed with myeclipse ide for Angular2
Downloaded and installed myeclipse without problems, but when I try to create a new angular project out of the gate I get Download of Node 7.9.0 failed, but that's what I already have installed.
dp$ node -v
v7.9.0

DanPride
- 150
- 11
0
votes
0 answers
Toggling Material Design 2 nav menu in two separate Angular 2 component templates
I am using Material Design 2 to toggle the left side nav:
In the header bar template:
In the left side nav template:

bschmitty
- 1,118
- 3
- 16
- 46
0
votes
0 answers
Angular 2 directive override component's input
I have a Paragraph component and it has an input called "align". I want to be able to override this input in a directive.
@Component({
selector: "paragraph",
encapsulation: ViewEncapsulation.None,
template: `

Rahman Usta
- 716
- 3
- 14
- 28
0
votes
0 answers
Add directive to component generated dynamically
I was searching, how create a component dinamicamente y followed the steps the Equivalent of $compile in Angular 2 and running perfect
import {Component, Input} from '@angular/core';
import {Observable} from "rxjs/Rx";
@Component({
selector:…

Darlyn
- 310
- 1
- 2
- 16
0
votes
1 answer
Modify sebm-google-map-marker using an angular2 directive
I'm using angular2-google-maps https://angular-maps.com/ to build a google map with markers. What I'm trying to achieve is creating a marker which is customised with an users social media profile pic. I am going to use this: JS Maps v3: custom…

Gavin Bruce
- 1,799
- 16
- 28