All Categories

  • Angular2 HelloWorld

  • Detect Breakpoint at Angular

    2/1/2019 -
    Detect breakpoint by use @angular/cdk breakpoint usually is CSS, you write media query for different style for different view. However, sometime you might want to do that in Javascript instead of CSS. At this blog, we'll use @angular/cdk at Angular Universal App project. First intall @angular/cdk "@angular/cdk": "^7.3.3", Add Layout Module to root angular module import { LayoutModule } from "@angular/cdk/layout"; @NgModule({ declarations: [AppComponent, HomeComponent], imports: [ BrowserModule.withServerTransition({ appId: "my-app" }), RouterModule.forRoot([ { path: "", component: HomeComponent, pathMatch: "full" }, { path: "lazy", loadChildren: "./lazy/lazy.module#LazyModule" }, { path: "lazy/nested", loadChildren: "./lazy/lazy.