Skip to content

Instantly share code, notes, and snippets.

@branflake2267
Last active June 5, 2019 22:54
Show Gist options
  • Save branflake2267/0af4b6ae8e696bdd0b18da40b80af075 to your computer and use it in GitHub Desktop.
Save branflake2267/0af4b6ae8e696bdd0b18da40b80af075 to your computer and use it in GitHub Desktop.
Simple Sencha ExtAngular App, one file
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My ExtAngular app example</title>
<base href="/">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/x-icon" href="favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=10, user-scalable=yes">
</head>
<body>
<app-root></app-root>
</body>
</html>
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, Component } from '@angular/core';
import { ExtAngularModule } from '@sencha/ext-angular'
declare var Ext: any
@Component({
selector: 'app-root',
styles: [`
`],
template: `
<container #item padding="10">
<button #item
text="Say Hello"
[handler]="this.sayHello"
ui="action raised"
></button>
<button #item
text="Say Goodbye"
[handler]="this.sayGoodbye"
></button>
<div #item>
{{ this.message }}
</div>
</container>
`
})
export class AppComponent {
message: string;
sayHello = () => {
this.message = 'Hello world!';
}
sayGoodbye = () => {
this.message = 'Goodbye cruel world.';
}
}
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule, ExtAngularModule
],
providers: [
],
bootstrap: [
AppComponent
]
})
export class AppModule {}
platformBrowserDynamic().bootstrapModule(AppModule);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment