Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not able to use ngIf/ngFor directives in project #1126

Closed
AlbertoHdezCerezo opened this issue Oct 25, 2016 · 1 comment
Closed

Not able to use ngIf/ngFor directives in project #1126

AlbertoHdezCerezo opened this issue Oct 25, 2016 · 1 comment

Comments

@AlbertoHdezCerezo
Copy link

AlbertoHdezCerezo commented Oct 25, 2016

Hi everyone,

Recently I started working on Angular 2 with this project.

I am trying to set up a simple template with some ng directives, and whenever I include them in my HTML a parsing error appears:

<div [ngIf]="videoList.length === 0" class="video-list ui basic segment center aligned">
    <h1 class="ui header">
        <img src="" class="ui medium image">
        <div class="content">
            Media Content
            <div class="sub header">Manager</div>
        </div>
    </h1>
</div>
import { Component } from '@angular/core';

import Video from '../../funke-base/models/Video';

@Component({
  selector: 'funke-video-search',
  styleUrls: [ '../resources/scss/video-list.scss' ],
  templateUrl: '../resources/html/video-list.tpl.html',
})
export class VideoListComponent {

    public videoList: Video[];
    public currentPage: number = 1;

    constructor() {
        this.videoList = [];
    }
}

With this code I always get the error:

main.browser.ts:25 Error: Template parse errors:
Can't bind to 'ngIf' since it isn't a known property of 'h1'.

When I remove the ngIf directive from the code it works great. Is there something I am doing wrong/any problem with my configuration?

@AlbertoHdezCerezo
Copy link
Author

Done, sorry was not importing the proper modules

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant