angular2-directives Questions
4
Solved
My app has many images with descriptions. When user navigates, the text appears first and the image loads with some delay. I would like to add a spinner here. A directive which shows spinner while ...
Gurgitation asked 21/6, 2016 at 5:44
2
I am trying to assign *ngIf directive from angular code to the template during runtime. Not been able to figure out a way to do it. Is view/templateref an option to do it or is there a different wa...
Grandstand asked 22/4, 2018 at 7:10
4
If I have a simple button with a click handler and a custom attribute directive like so:
<button (click)="save()" attributedirective="project saved">Save</button>
And in my attribute...
Jubilation asked 9/8, 2016 at 10:0
2
Solved
I have an Angular project with Webpack, and I am trying to use an img tag with ng-src, per the Angular docs here:
https://docs.angularjs.org/api/ng/directive/ngSrc
I am trying to have a variable ...
Macneil asked 10/5, 2017 at 2:16
1
Solved
I've created a directive to limit the length of input field type=number.
// Input
<input min="1" appLimitTo [limit]="5" type="number" name="property" [(ngModel)]="property">
// Directive
...
Kosher asked 9/4, 2018 at 13:15
2
Solved
I have a component, creating another component with ComponentFactoryResolver. It seems to work fine, I can access data through the @Input. Problem is ngOnChanges never gets called when the componen...
Intercourse asked 30/3, 2017 at 8:42
3
Solved
Long time user, first time question asker! I've been trying to figure this out for the better part of two days to no avail, so here we go.
Dynamic compiled templates from external sources in Angul...
Argyll asked 8/2, 2017 at 20:53
4
Solved
I'm new to angular in general and to angular2 specifically. I'm trying to write a container component, which should have child components in it.
For example, container component:
@Component({
s...
Blowgun asked 1/3, 2016 at 21:17
3
I am performing CRUD Operations with multiple fields. I have [(ngModel)] for all the fields.
I am not interested to changed the name of the [(ngModel)] or assign any value in the register.ts or...
Botts asked 5/2, 2018 at 11:12
1
Using angular 2 to bind a raw html inside a DIV
Version:
Angular 2 "2.0.0-rc.1"
References on index.html:
<script src="~/lib/ng/shim.min.js"></script>
<script src="~/lib/ng/zone.m...
Manymanya asked 15/6, 2016 at 16:32
1
I am trying to implement "Anchor Jumping" functionality using JavaScript and Angular 2 in my application, Means user can jump across the section within a page.
As per the client requirement, User ...
Recreant asked 23/5, 2017 at 12:34
1
I have a recursive structure that's composed of two components:
OptionsMenuComponent (A menu)
MenuItemComponent (The menu items)
OptionsMenuComponent: (Template + Component)
Template:
<men...
Tarazi asked 27/7, 2016 at 11:59
6
Solved
I sometimes have a component that can receive text like this:
text www.website.com
But I would like to convert it to a url if it is a link. Like this.
text www.website.com
I read this SO ...
Boldface asked 1/9, 2016 at 16:30
2
Solved
I'm using an ngfor to display a varying amount of items. I want to limit the amount of items it can display to 5 so I use:
<li *ngFor="let item of items; let i = index;">
<div *ngIf="i &...
Stelly asked 2/9, 2016 at 0:33
2
Solved
Is is possible to limit which component can have custom directive?
For example:
@Directive({
selector: '[myHighlight]',
host: "my-component" //!!!!!!!!!
})
export class HighlightDirective {
...
Dinny asked 29/9, 2017 at 11:33
0
I am using facebook comment plugin in my ionic app and using below code snippet in index.html
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsB...
Khrushchev asked 17/12, 2017 at 5:2
3
Solved
I make a componenet in which I have one input field and button.On click of button I am diplaying the second component.I want to send data from one component to another component ?
how I will send ...
Hendren asked 15/1, 2016 at 2:44
1
I am following Template syntax section for the application of built-in attribute and structural directives from here https://v4.angular.io/guide/template-syntax#ngclass
currentClasses: {};
setCur...
Conditioner asked 18/11, 2017 at 19:58
3
Solved
I came across the following angular directive:
import { Directive , HostListener , HostBinding } from '@angular/core';
@Directive({
selector: '[appDropdown]'
})
export class DropdownDirective {...
Connolly asked 30/10, 2017 at 18:49
1
Is it possible to import Directive into Component? I want to avoid importing into ngModule.declarations.
I am following CustomDirective for Telerik Angular Grid. It is suggested to populate grid w...
Garland asked 23/11, 2017 at 8:27
1
Solved
I have simplest Angular structural directive:
import { Directive, TemplateRef, ViewContainerRef } from '@angular/core';
@Directive({ selector: '[hello]' })
export class HelloDirective {
construc...
Rumery asked 18/11, 2017 at 3:18
3
Solved
How can I call this.firms within a data forEach()?
I know how to do this in Angular1, but not with my current project in Angular 2.
Currently it works fine outside of the forEach, but not within....
Hunt asked 11/5, 2017 at 11:55
2
Solved
I have a component to which I am passing a template. Inside of this component I would like to pass context so that I could display data.
@Component({
selector: 'my-component',
providers: [],
te...
Kajdan asked 21/12, 2016 at 23:9
2
Solved
I'm trying to create a directive that accepts in input a icon property which would be the icon name. So the directive internally would try to find a span element where it will apply a class. I wond...
Rabin asked 10/3, 2017 at 9:53
3
Solved
Although it looks trivial, I didn't find any similar cases
Here's my route :
{
path: 'folder/:id',
component: FolderComponent,
children: [
{
path: 'edit/:form',
component: 'EditorComponent'...
Irritation asked 9/11, 2016 at 10:17
© 2022 - 2024 — McMap. All rights reserved.