Fetch your npm credentials and generate an application.
To gain access to the Sencha npm repository:
- Note: Ext JS enterprise customers already have access to ExtAngular.
- Note: Existing customers use your support portal credentials. But switch the username,
@
character with'..'
two periods, so the username would look something like this after it's converted:name..gmail.com
.
Once you have your credentials login to the npm repo.
npm login --registry=https://npm.sencha.com --scope=@sencha
If you don't already have a Angular application generate an Angular application.
- Install the app generation CLI.
npm install -g @angular/cli
- Generate an Angular appication.
ng new ext-angular-modern-demo --minimal=true --interactive=false -g=true --skipInstall=false
In the project, install the ExtAngular components dependency in the package.json.
npm install @sencha/ext-modern-runtime --save
npm install @sencha/ext-angular-modern --save
Optional: Configure CSS
In the file [project]/src/styles.css add some normalizing css.
/* file: [project]/src/styles.css */
:root {
--base-color: #024059;
--base-foreground-color: white;
--background-color: white;
--color: black;
}
Configure the Angular App Module
In the file [project]/src/app/app.module.ts add the ExtAngular components import.
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
// 1. Import the ExtAngular components
import { ExtAngularModernModule } from '@sencha/ext-angular-modern';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
// 2. Delclare the ExtAngular import in the app module imports.
ExtAngularModernModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
Configure a Component with ExtAngular Component In the file [project]/src/app/app.component.ts declare an ExtAngular component in the html template.
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
template: `
<!-- ExtAngular Component simple Example -->
<ExtButton text="My Button" shadow="true"></ExtButton>
`,
styles: []
})
export class AppComponent {
}
Run the app with npm start
npm start