Estou fazendo uma aplicação e mesmo depois de adicionar ao meu módulo o CommonModule
import { CommonModule } from '@angular/common';
Ainda estou recebendo o erro
Can't bind to 'NgForOf' since it isn't a known property of 'li'
O projeto está no repositório: https://github.com/wferreira1/sempre-charme
Esse é o arquivo navbar.module.ts
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NavbarComponent } from './navbar.component';
@NgModule({
declarations: [
NavbarComponent
],
imports: [
CommonModule
],
providers: [],
bootstrap: [NavbarComponent]
})
export class NavbarModule { }
navbar.component.ts
import { Component, OnInit } from '@angular/core';
import { Opcoes } from './navbar.opcoes.interface';
import { ClienteInterface } from '../cliente/cliente.interface';
@Component({
selector: 'sc-navbar',
templateUrl: './navbar.component.html'
})
export class NavbarComponent implements OnInit {
public cliente: ClienteInterface = <ClienteInterface>{};
public title: string = '';
public opcoes: Opcoes[] = [];
constructor() { }
ngOnInit() {
this.title = 'Inicio';
this.cliente = <ClienteInterface>{nome: 'Wesley', login: 'wesleyoliveira@e.com.br', photo: 'https://goo.gl/LLBW21', empresa: 'Sempre Charme'};
if(! <number>this.opcoes.length ){
this.opcoes = <Opcoes[]>[{
name: "Marcar Horário",
link: "#",
icon: "access_time",
onMobile: true
},{
name: "Histórico",
link: "#",
icon: "hourglass_empty",
onMobile: true
},{
name: "Pagamento",
link: "#",
icon: "credit_card",
onMobile: true
},{
name: "Pacotes",
link: "#",
icon: "shopping_basket",
onMobile: true
},{
name: "Perfil",
link: "#",
icon: "#",
onMobile: false
},{
name: "Ajuda",
link: "#",
icon: "help",
onMobile: true
},{
name: "Configurações",
link: "#",
icon: "settings",
onMobile: true
}];
}
}
}