Angular 5 Material Tabs - LearnHowToCode SarkariResult.com Interview Questions and Answers LearnHowToCodeOnline
Angular 5 Material Tabs

Angular 5 Material Tabs



In this article you learn Angular Material Tabs organize the content into separate tabs views where only one view can be visible at a time and other tabs hidden i.e.

tabs.html -
<mat-tab-group>
  <mat-tab label="AngularJs">
   <p>The angularjs is a JavaScript [MVW || MV*] framework and Its maintain by Google. The most of use to creating to single-page applications (SPA) with the MVC pattern. Its used for both client-side and server-side web application etc.</p>
  </mat-tab>
  <mat-tab label="Angular 2">
    <p>Angular 2 is a most popular framework for developing mobile apps.  It is also for “desktop” as well “mobile” applications.  The Angular 6 is development phase you know very well and hopefully you love.</p>
  </mat-tab>
  <mat-tab label="Angular 4">
    <p>Angular 4 contains some additional Enhancement and Improvement. Consider the following enhancements. <br/>
  1. Smaller and Faster Apps <br/>
  2. View Engine Size Reduce <br/>
  3. And Many more
</p>
  </mat-tab>
  <mat-tab label="Angular 5">
     <p>Angular 5 doc</p>
  </mat-tab>
</mat-tab-group>

And tabs.ts -
import {Componentfrom '@angular/core';

/** @title Angular material tabs  */
@Component({
  selector: 'tabs',
  templateUrl: 'tabs.html',
  styleUrls: ['tabs.css'],
})
export class TabsExample {}


And NgModule with angular material file –
import {BrowserModulefrom '@angular/platform-browser';
import {platformBrowserDynamicfrom '@angular/platform-browser-dynamic';
import {BrowserAnimationsModulefrom '@angular/platform-browser/animations';

import {CdkTableModulefrom '@angular/cdk/table';
import {HttpClientModulefrom '@angular/common/http';
import {NgModulefrom '@angular/core';
import {FormsModuleReactiveFormsModulefrom '@angular/forms';
import {HttpModulefrom '@angular/http';

import {TabsExamplefrom './app/tabs';

import {
  MatAutocompleteModule,
  MatButtonModule,
  MatButtonToggleModule,
  MatCardModule,
  MatCheckboxModule,
  MatChipsModule,
  MatDatepickerModule,
  MatDialogModule,
  MatDividerModule,
  MatExpansionModule,
  MatGridListModule,
  MatIconModule,
  MatInputModule,
  MatListModule,
  MatMenuModule,
  MatNativeDateModule,
  MatPaginatorModule,
  MatProgressBarModule,
  MatProgressSpinnerModule,
  MatRadioModule,
  MatRippleModule,
  MatSelectModule,
  MatSidenavModule,
  MatSliderModule,
  MatSlideToggleModule,
  MatSnackBarModule,
  MatSortModule,
  MatStepperModule,
  MatTableModule,
  MatTabsModule,
  MatToolbarModule,
  MatTooltipModule,
from '@angular/material';

@NgModule({
  exports: [
    CdkTableModule,
    MatAutocompleteModule,
    MatButtonModule,
    MatButtonToggleModule,
    MatCardModule,
    MatCheckboxModule,
    MatChipsModule,
    MatStepperModule,
    MatDatepickerModule,
    MatDialogModule,
    MatDividerModule,
    MatExpansionModule,
    MatGridListModule,
    MatIconModule,
    MatInputModule,
    MatListModule,
    MatMenuModule,
    MatNativeDateModule,
    MatPaginatorModule,
    MatProgressBarModule,
    MatProgressSpinnerModule,
    MatRadioModule,
    MatRippleModule,
    MatSelectModule,
    MatSidenavModule,
    MatSliderModule,
    MatSlideToggleModule,
    MatSnackBarModule,
    MatSortModule,
    MatTableModule,
    MatTabsModule,
    MatToolbarModule,
    MatTooltipModule,
  ]
})
export class DemoMaterialModule {}

@NgModule({
  imports: [
    BrowserModule,
    BrowserAnimationsModule,
    FormsModule,
    HttpModule,
    HttpClientModule,
    DemoMaterialModule,
    MatNativeDateModule,
    ReactiveFormsModule,
  ],
  entryComponents: [TabsExample],
  declarations: [TabsExample],
  bootstrap: [TabsExample],
  providers: []
})
export class AppModule {}

platformBrowserDynamic().bootstrapModule(AppModule);




The live Result link https://stackblitz.com/edit/angular-1omip7-mucmrp


About Mariano

I'm Ethan Mariano a software engineer by profession and reader/writter by passion.I have good understanding and knowledge of AngularJS, Database, javascript, web development, digital marketing and exploring other technologies related to Software development.

0 comments:

Featured post

Political Full Forms List

Acronym Full Form MLA Member of Legislative Assembly RSS Really Simple Syndication, Rashtriya Swayamsevak Sangh UNESCO United Nations E...

Powered by Blogger.