Questions tagged [angular2-template]

For questions referencing Angular Template Syntax including: interpolation, input(property) bindings, output(event) bindings, two-way binding, local variables, star syntax, etc. This tag is specific to angular version 2.x and above

Tag content based loosely off Victor Savkin's Angular Template Syntax article

2856 questions
1
vote
1 answer

How to get return value of function of angular2 in html or markup

Is there anyway to put the return value of a function in the markup for example:

Days diff {{compareDays(task.dueDate)}}

this is my function: public compareDays(date: Date): string { let oneDay = 24 * 60 * 60 * 1000; //…
CommonSenseCode
  • 18,848
  • 28
  • 112
  • 163
1
vote
1 answer

Angular2 Event: keyup exits input

I have an input element bound to a property of my component which should update as of when I change the text in the input field. My code so far:
sandrooco
  • 4,955
  • 6
  • 29
  • 69
1
vote
1 answer

Angular2 datePipe returning formatted date but with an additional month

This is my formatter function: public formatDate(date: Date): string { var datePipe = new DatePipe(); if (date) { return datePipe.transform(date, 'yMd'); } else { return "--"; } }; When I use it let dateFooBar =…
1
vote
1 answer

Angular2 the for attribute on a label does not link it to the input

I am working with Angular2 RC5. I have a component encapsulating a label and an input import { Component, Input} from '@angular/core'; @Component({ selector: 'my-input', template: `
1
vote
2 answers

Angular2 Component Relative Paths Visual Studio 2015 module.id error - Cannot find name 'module'

I am following the Component Relative Paths for templates and styles guide available at: https://angular.io/docs/ts/latest/cookbook/component-relative-paths.html The guide suggests that if we build our application as commonjs modules and load those…
1
vote
1 answer

angular 2 rc5 template parse error

I keep getting this error when I'm trying to create an angular routing link: zone.js:461 Unhandled Promise rejection: Template parse errors: Can't bind to 'routerLink' since it isn't a known property of 'a'. ("
Tyler
  • 2,036
  • 5
  • 29
  • 56
1
vote
1 answer

How to filter Observable Array in Angular 2.0?

I have a simple application which gets information from my API, stores it in memory and then present. My main component code: export class AppComponent implements OnInit { builds$: Observable; ngOnInit(): void { this.builds$ =…
Yung J
  • 13
  • 4
1
vote
3 answers

Angular2 One-way binding form doesn't get cleared after data save

I have a form where inputs are bound to object one-way. When saving form I read form data and send it to server, then update my model…
Bogac
  • 3,364
  • 4
  • 28
  • 53
1
vote
0 answers

Angular2 Grab all Canvas Elements in View Template from Component?

I'd like to grab all the canvas elements from a component's view template. The canvas elements are rendered in a ngFor, so I could have 0,... canvas elements in the viewtemplate. I need to grab them and use a component method to draw them. How…
cobolstinks
  • 5,678
  • 13
  • 51
  • 86
1
vote
1 answer

Angularjs 2 RC5 Form can not be loaded

This is pretty annoying issue for the form. My package.json is: "dependencies": { "@angular/common": "2.0.0-rc.5", "@angular/compiler": "2.0.0-rc.5", "@angular/core": "2.0.0-rc.5", "@angular/forms": "0.3.0", "@angular/http":…
user3006967
  • 2,551
  • 9
  • 36
  • 58
1
vote
1 answer

Catch event in sibling component

My app looks like this : I'd like to communicate from my-toolbar to my-cube-container. I'm sending an event from the toolbar : @Component({ selector:…
Ced
  • 12,657
  • 11
  • 62
  • 124
1
vote
1 answer

Work with Foundation 6 in Angular 2

As I know I should put $(this.elementRef.nativeElement).foundation() in each component when I want use foundation. But I couldn't understand in what part I should do it. For example I need use dropdown on hover.
Illorian
  • 1,164
  • 2
  • 11
  • 37
1
vote
0 answers

Form submitting twice in RC5

This form is calling onSubmit() twice I haven't configured any routes or any other instatiations Not sure if problem lies with RC5 or another issue?
Greg L
  • 161
  • 1
  • 1
  • 4
1
vote
1 answer

Angular 2 - Can't bind to 'ngModel' since it isn't a known property of 'input'

I have a Angular 2 Inline Editing component in plunker. But suddenly i'm getting the above error. What happened to it? Plunker code: http://plnkr.co/edit/3AODo6YGEhvPOKzloofz?p=preview Parent component:
Varun
  • 3,355
  • 4
  • 18
  • 33
1
vote
1 answer

How get style values from a HTMLElement with angular2 and Typescript

is it possible to read out the values from an HTMLElement? The following code is working, but it has a small delay in the backwards transition. Thats the point I need the height value from the _target element. import { Directive, Input, Renderer,…
Zero
  • 165
  • 2
  • 10
1 2 3
99
100