Adding Momentum Design to an Angular CLI application

Momentum Design is a collection of design guidelines and a software toolkit for designers and developers. It provides various components that are required for building a cohesive experience for web applications. You can find out more information about the various components provided by Momentum Design at https://momentum.design/components. They provide components for React, Angular, and Vue.

Now, let's add Momentum Design for Angular to our application using the following ng add command:

> ng add @momentum-ui/angular --project es-admin --module apps/es-admin/src/app/app.module.ts

Let's also add a nav component from Momentum Design using Momentum Design's schematics:

> ng generate @momentum-ui/angular:nav nav --project es-admin --style scss

Let's remove the Momentum Design's modules declaration from the AppModule of the es-admin project and add it to the SharedModule:

import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { TopbarModule, ButtonModule, ListItemModule } from '@momentum-ui/angular';

const SHARED_MODULES = [
TopbarModule,
ButtonModule,
ListItemModule
];

@NgModule({
imports: [CommonModule, ...SHARED_MODULES],
exports: [...SHARED_MODULES]
})
export class SharedModule {}

Now, let's use the nav in our app.component.html file by replacing all the content with the following:

<div class="md md--sites">
<es-nav></es-nav>

<router-outlet></router-outlet>
</div>

In the Terminal, we need to stop our electronic-store application so that the ports do not conflict when we run ng serve in a new Terminal:

> ng serve es-admin --port 4201

This should serve our application on http://localhost:4201.

You should be able to see a navigation bar in the browser. Now, we need to set up NgRx so that we can manage our application's state.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.238.76