@the5x

Где ошибка при создании компонента в Angular 2.2?

Хочу создать компонент в Angular 2 (2.2)

import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';
import { SpinnerComponent } from './components/spinner';

@NgModule({
  declarations: [SpinnerComponent],
  imports: [CommonModule],
  providers: [],
})
export class SpinnerModule {}


import { ChangeDetectionStrategy, Component } from '@angular/core';

@Component({
  changeDetection: ChangeDetectionStrategy.OnPush,
  selector: 'app-spinner',
  template: require('./spinner.html'),
})
export class SpinnerComponent {
 
}


Выдает такую ошибку:

'app-spinner' is not a known element:
1. If 'app-spinner' is an Angular component, then verify that it is part of this module.
2. If 'app-spinner' is a Web Component then add "CUSTOM_ELEMENTS_SCHEMA" to the '@NgModule.schemas' of this component to suppress this message. ("[ERROR ->]
  • Вопрос задан
  • 35 просмотров
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы
IT Force Краснодар
от 200 000 ₽
от 1 000 000 до 1 200 000 ₽
Legal Resources Санкт-Петербург
от 90 000 до 120 000 ₽