I was excited to find about the material tabs stuff at https://material.angular.io/components/tabs/api#MatTab and was excited to use it in my project.
I added the import as suggested and it wasn't working. I found: can not find module "@angular/material" and imported the stuff and got the import working on my maintab component.
But the mat-tab links are still not working. So here's my maintab.component.ts
import { Component, OnInit } from '@angular/core';
import {MatTabsModule} from '@angular/material';
@Component({
selector: 'app-maintab',
templateUrl: './maintab.component.html',
styleUrls: ['./maintab.component.css']
})
export class MaintabComponent implements OnInit {
constructor() { }
ngOnInit() {
}
}
And here's my maintab.component.html
<mat-tab-group>
<mat-tab label="One">
<h1>Some tab content</h1>
<p>...</p>
</mat-tab>
<mat-tab label="Two">
<h1>Some more tab content</h1>
<p>...</p>
</mat-tab>
</mat-tab-group>
I'm still getting these type of errors:
Error: Template parse errors:
'mat-tab' is not a known element:
1. If 'mat-tab' is an Angular component, then verify that it is part of this module.
2. If 'mat-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("<mat-tab-group>
[ERROR ->]<mat-tab label="One">
<h1>Some tab content</h1>
<p>...</p>
"): ng:///AppModule/MaintabComponent.html@1:2
'mat-tab' is not a known element:
1. If 'mat-tab' is an Angular component, then verify that it is part of this module.
2. If 'mat-tab' is a Web Component then add 'CUSTOM_ELEMENTS_SCHEMA' to the '@NgModule.schemas' of this component to suppress this message. ("
<p>...</p>
</mat-tab>
I just don't know what to do next.