Create Sample Demo

This section explains how to use the business components easily from Cedrus Fusion Library in an application. The demo is presented by creating a sample application from scratch that uses/wires two business components from the library following the below steps:

  1. Generate a new project using Angular Cli

  2. Install Angular Material

  3. Install Cedrus Fusion Library

  4. Use the needed components and Wire them together.

Generate a new Project

To create a new Angular 2 project, all what you to do is install angular-cli and then use it to create your project as following:

  1. "npm install -g angular-cli" <--- Install Angular Cli

  2. "ng new PROJECT_NAME" <--- Create your project

  3. "cd PROJECT_NAME" <-Access your project directory

Install Angular Material

To install angular material in your cli project, all what you have to do is:

  1. "npm install --save @angular/material" <--- Install Angular Material

  2. "npm install --save hammerjs" <--- Support library for Angular Material

  3. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"> <-- Include inindex.html

  4. Update app.module.ts by:

import { MaterialModule } from '@angular/material';

Add "MaterialModule.forRoot()" in the imports array of ngModule.

Install Cedrus Fusion Library

  1. "npm install --save cedrus-fusion" <---Install the library

  2. Update app.module.ts by:

import { CfModule } from 'cedrus-fusion/src/app/app.module';

Add "CfModule" in the imports array of ngModule.+

Use the needed components and Wire them together

Refer to the documentation of the components, create your customized objects to describe them and use the components in your templates.

Last updated