I have a functional application built with the Angular CLI v-13.2.6 and I just want to add the great features of angular material forms and icons. I am already using the Component
decorator in my class therefore I get an error when trying to use NgModule
.
My question is, Is there any way to implement Angular/Material with that Component
decorator on my class/without NgModule
? Or, is there any way to get float-forms without using Angular Material?
I followed all instructions here: https://material.angular.io/guide/getting-started.
install materials -> ng add @angular/material
import component to .ts ->
import { Component, NgModule, OnInit } from '@angular/core';
import { MatFormFieldModule } from '@angular/material/form-field';
@NgModule({
imports: [
MatFormFieldModule,
]
})
However when run the app I get the following angular error:
N1006 two incompatible decorators on class.
From what I have read I understand that I cannot have 2 decorators on the same class.
This is what is in the existing code and I am not allowed to change it:
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-pagexx',
templateUrl: './pagexx.html',
styleUrls: ['./pagexx.scss']
})