angular2-directives Questions
1
Solved
I have an Angular 1.x directive that appends an element. In short:
app.directive('mydirective', function() {
template: '<ng-transclude></ng-transclude>',
link: function(el) {
var chi...
Marhtamari asked 13/7, 2017 at 15:47
1
Solved
I work with angular-material mdSidenav and want to programmatically open it and insert custom component.
I use @ViewChild('varName') to extract componentInstance and @ViewChild('varName', {read: V...
Torino asked 12/7, 2017 at 17:54
3
Can't find any tutorial of how to use angular2-data-table library is here: https://github.com/swimlane/angular2-data-table
The documentation seems to be lacking simple examples.
Can any one give ...
Radiomicrometer asked 14/11, 2016 at 19:23
1
Solved
I have an Angular 2 component which, on some user action, loads html from a database. The html contains anchor tags with relative paths. Given that I don't want the whole application to reload when...
Crumpled asked 6/7, 2017 at 13:11
1
Solved
The following directive should hide an element.
import {Directive, ElementRef, Input, Renderer2} from '@angular/core';
import {el} from "@angular/platform-browser/testing/src/browser_util";
// Di...
Fossorial asked 29/6, 2017 at 6:47
1
Solved
I want to override the template of the DataTable component of primeng and this is how my code looks like:
my-datatable.component.ts
import { Component, OnInit, ElementRef, Renderer2, ChangeDetect...
Reld asked 5/6, 2017 at 18:25
1
Solved
How can I define my directive for use it in all component :
my directive.ts :
import { Parent } from '../../_common/Parent';
declare var jQuery: any;
@Directive({
selector: '[icheck]'
})
expor...
Filberte asked 26/6, 2017 at 13:34
1
Solved
I would like to display different template in my component. Only one will show.
If hasURL is true, I want to show the <a></a>.
If hasURL is false, I want to show the <button></...
Bullish asked 22/6, 2017 at 12:30
4
Solved
I have an input with [disabled] depending upon the ngModel of another input. Initially [disabled] is working properly but not when we change the dependant input value, the [disabled] property is no...
Dufour asked 1/6, 2017 at 7:48
2
Solved
How do I add a html template to a directive? Here is a sample code which does not work :
import { Directive } from '@angular/core';
@Directive({
selector: '[master-side-bar]',
templateUrl :...
Senegal asked 27/5, 2017 at 17:5
4
Solved
I am trying to import component from one file another root component file.
it give error as ..
zone.js:484 Unhandled Promise rejection: Template parse errors:
'courses' is not a known element:
...
Biscay asked 9/9, 2016 at 11:20
2
Solved
I have created img-pop component which has @Input() bind property src.
I have created authSrc directive which has @HostBinding() property src.
@Component({
selector: 'img-pop',
template: `<img...
Sancha asked 15/5, 2017 at 14:19
1
Solved
I have running the sample application to learn angular 2. In my sample application [(ngModel)] is not working. But when i removes the square brackets (ngModel) the screen is loading but two way bin...
Frizzle asked 16/5, 2017 at 7:22
2
Solved
I'm confused a bit. I need to hide block if result have one of several cases. But seems it not working correctly...
<div *ngIf="currentStatus !== 'open' || currentStatus !== 'reopen' ">
&l...
Kassa asked 5/5, 2017 at 9:50
5
Solved
has anyone created any sample Angular Directive using @Directive decorator? I searched a lot on however all developers so far created component directives. Even Angular API Review doesn't speak mor...
Psalmist asked 27/1, 2016 at 21:58
1
Since angular 2 is not coming with a full rich components, I decided to use bootstrap inside angular 2. I know this is not the best idea as it breaks the virtual dome issue, but I have no other sol...
Anderson asked 20/2, 2016 at 21:55
4
Solved
I am creating reusable table component which will enable editing of objects fields to prepare them for sending to the API.
Having an object:
person: {
name: "John"
job: {
type: "IT"
title: "S...
Enduring asked 23/4, 2017 at 10:40
2
I keep getting the error
Can't bind to 'ngIfElse' since it isn't a known property of 'ul'.
I'm sure somewhere I am making a stupid mistake but can't find it.
<ul *ngIf="!finished; else el...
Superdominant asked 20/4, 2017 at 1:31
1
Solved
There is some restrictions in name field so I am trying to validate name field using directive as below. Inside directive I am using regular expression to check valid name and then replacing valid ...
Serrated asked 19/4, 2017 at 10:0
3
Solved
I'm new at Angular and I'm still trying to understand it. I've followed the course on the Microsoft Virtual Academy and it was great, but I found a little discrepancy between what they said and how...
Taw asked 19/4, 2017 at 10:4
4
Solved
Does anybody have any idea on how to implement Amcharts into Angular2 (BETA)?
I was trying to follow the path/pattern of this question however, I was pretty successful with charts.js, but unfortu...
Noisy asked 13/1, 2016 at 6:38
3
I'm trying to create a directive which takes an input element and surrounds it with a div, so for example, my html would be something like:
<input type="text" class="form-control" inputWrapper ...
Globefish asked 7/4, 2017 at 15:52
2
Solved
I dont know if this is a problem or normal behavior.
If we have a form like this:
<form #form="ngForm" >
<div>
<label>field1</label>
<input type="text" name="field1"...
Girard asked 5/4, 2017 at 12:50
1
Solved
I'm trying to get an angular directive to repeat inside a <tr>. Without the directive, the code is
<tr *ngFor='let cluster of clusters'>
<td style='display: flex; flex-direction: c...
Rotogravure asked 30/3, 2017 at 17:28
1
I am creating a DOM structure and only want to add some parts in some visual components at first time and do not want them to be refreshed again and again which is the way *ngIf would work. This is...
Infective asked 27/3, 2017 at 13:20
© 2022 - 2024 — McMap. All rights reserved.