Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove a lot of type annotation hint inside the templates
- Loading branch information
Showing
39 changed files
with
318 additions
and
260 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/cli/frameworks/angular/template/src/angular.main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Polyfills | ||
import 'core-js/features/reflect'; | ||
import 'zone.js/dist/zone'; | ||
|
||
import { enableProdMode } from '@angular/core'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { AppModule } from './angular.module'; | ||
|
||
const ENVs = { | ||
NODE_ENV: '$$NODE_ENV$$', | ||
}; | ||
if (ENVs.NODE_ENV === 'production') { | ||
enableProdMode(); | ||
} | ||
|
||
platformBrowserDynamic() | ||
.bootstrapModule(AppModule) | ||
.then(() => {}) | ||
.catch(() => {}) | ||
.finally(() => {}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 11 additions & 9 deletions
20
packages/cli/frameworks/angular/template/src/components/series/edit/component.angular.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,26 @@ | ||
import { Component, Input, OnChanges } from '@angular/core'; | ||
import { GenericComponent } from '@leanup/lib/components/generic'; | ||
|
||
import { ResolvedRoute } from '../../app/controller'; | ||
import { EditSerieController } from './controller'; | ||
|
||
@Component({ | ||
selector: 'edit-serie', | ||
template: ` | ||
<form (ngSubmit)="$ctrl.onSubmit()"> | ||
<form (ngSubmit)="ctrl.onSubmit()"> | ||
<h5>Edit a existing measuring serie</h5> | ||
<editor-serie [editorForm]="$ctrl.editorForm"></editor-serie> | ||
<editor-serie [editorForm]="ctrl.editorForm"></editor-serie> | ||
<button class="btn btn-primary" type="submit" id="submit">Edit</button> | ||
<button class="btn btn-secondary" type="reset" id="cancel" (click)="$ctrl.onCancel()">Abbrechen</button> | ||
<button class="btn btn-danger" id="delete" type="button" (click)="$ctrl.onDelete()">Delete</button> | ||
<button class="btn btn-secondary" type="reset" id="cancel" (click)="ctrl.onCancel()">Abbrechen</button> | ||
<button class="btn btn-danger" id="delete" type="button" (click)="ctrl.onDelete()">Delete</button> | ||
</form> | ||
`, | ||
}) | ||
export class EditSerieComponent implements OnChanges { | ||
public $ctrl: EditSerieController = new EditSerieController(null); | ||
@Input() public resolvedRoute: any; | ||
export class EditSerieComponent implements OnChanges, GenericComponent { | ||
public ctrl: EditSerieController = new EditSerieController(0); | ||
@Input() public resolvedRoute: ResolvedRoute; | ||
|
||
public ngOnChanges() { | ||
this.$ctrl.changeMeasuredSerie(this.resolvedRoute.params.id); | ||
public ngOnChanges(): void { | ||
this.ctrl.changeMeasuredSerie(this.resolvedRoute.params.id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1 @@ | ||
// Polyfills | ||
import 'core-js/features/reflect'; | ||
import 'zone.js/dist/zone'; | ||
|
||
import { enableProdMode } from '@angular/core'; | ||
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; | ||
|
||
import { AppModule } from './angular.module'; | ||
|
||
const ENVs = { | ||
NODE_ENV: '$$NODE_ENV$$', | ||
}; | ||
if (ENVs.NODE_ENV === 'production') { | ||
enableProdMode(); | ||
} | ||
|
||
platformBrowserDynamic().bootstrapModule(AppModule); | ||
import './angular.main'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/cli/frameworks/angularjs/template/src/angularjs.main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import './angularjs.module'; | ||
import './components/app/component.angularjs'; | ||
import './components/input/component.angularjs'; | ||
import './components/series/create/component.angularjs'; | ||
import './components/series/edit/component.angularjs'; | ||
import './components/series/editor/component.angularjs'; | ||
import './components/series/list/component.angularjs'; | ||
|
||
import * as angular from 'angular'; | ||
|
||
import { DI } from '@leanup/lib/helpers/injector'; | ||
|
||
import { APP_HTML_ELEMENT } from './shares/constant'; | ||
|
||
DI.register('Framework', { | ||
...require('angular/package.json'), | ||
name: 'AngularJS', | ||
}); | ||
require('./shares/register'); | ||
require('./shares/routing'); | ||
|
||
const htmlDivElement: HTMLDivElement | null = document.querySelector('div#angularjs'); | ||
if (htmlDivElement instanceof HTMLDivElement) { | ||
htmlDivElement.style.display = 'inline'; | ||
htmlDivElement.appendChild(APP_HTML_ELEMENT); | ||
angular.bootstrap(htmlDivElement, ['app']); | ||
} |
2 changes: 1 addition & 1 deletion
2
packages/cli/frameworks/angularjs/template/src/angularjs.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
import * as angular from 'angular'; | ||
|
||
export const ANGULARJS_MODULE = angular.module('app', []); | ||
export const ANGULARJS_MODULE: angular.IModule = angular.module('app', []); |
8 changes: 4 additions & 4 deletions
8
packages/cli/frameworks/angularjs/template/src/components/app/component.angularjs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
packages/cli/frameworks/angularjs/template/src/components/series/edit/component.angularjs.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1 @@ | ||
import './angularjs.module'; | ||
import './components/app/component.angularjs'; | ||
import './components/input/component.angularjs'; | ||
import './components/series/create/component.angularjs'; | ||
import './components/series/edit/component.angularjs'; | ||
import './components/series/editor/component.angularjs'; | ||
import './components/series/list/component.angularjs'; | ||
|
||
import * as angular from 'angular'; | ||
|
||
import { DI } from '@leanup/lib/helpers/injector'; | ||
|
||
import { APP_HTML_ELEMENT } from './shares/constant'; | ||
|
||
DI.register('Framework', { | ||
...require('angular/package.json'), | ||
name: 'AngularJS', | ||
}); | ||
require('./shares/register'); | ||
require('./shares/routing'); | ||
|
||
const htmlDivElement: HTMLDivElement | null = document.querySelector('div#angularjs'); | ||
htmlDivElement.style.display = 'inline'; | ||
htmlDivElement.appendChild(APP_HTML_ELEMENT); | ||
angular.bootstrap(htmlDivElement, ['app']); | ||
import './angularjs.main'; |
36 changes: 36 additions & 0 deletions
36
packages/cli/frameworks/aurelia/template/src/aurelia.main.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { bootstrap } from 'aurelia-bootstrapper'; | ||
import { Aurelia } from 'aurelia-framework'; | ||
import { PLATFORM } from 'aurelia-pal'; | ||
|
||
import { DI } from '@leanup/lib/helpers/injector'; | ||
|
||
DI.register('Framework', { | ||
...require('aurelia-framework/package.json'), | ||
name: 'Aurelia', | ||
}); | ||
require('./shares/register'); | ||
require('./shares/routing'); | ||
|
||
export function configure(aurelia: Aurelia): void { | ||
const htmlDivElement: HTMLDivElement | null = document.querySelector('div#aurelia'); | ||
if (htmlDivElement instanceof HTMLDivElement) { | ||
htmlDivElement.style.display = 'inline'; | ||
aurelia.use.standardConfiguration().developmentLogging(); | ||
aurelia | ||
.start() | ||
.then(() => { | ||
aurelia | ||
.setRoot(PLATFORM.moduleName('components/app/component.aurelia'), htmlDivElement) | ||
.then(() => {}) | ||
.catch(() => {}) | ||
.finally(() => {}); | ||
}) | ||
.catch(() => {}) | ||
.finally(() => {}); | ||
} | ||
} | ||
|
||
bootstrap(configure) | ||
.then(() => {}) | ||
.catch(() => {}) | ||
.finally(() => {}); |
6 changes: 3 additions & 3 deletions
6
packages/cli/frameworks/aurelia/template/src/components/app/component.aurelia.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
packages/cli/frameworks/aurelia/template/src/components/series/edit/component.aurelia.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import { bindable, bindingMode } from 'aurelia-framework'; | ||
|
||
import { ResolvedRoute } from '../../app/controller'; | ||
import { EditSerieController } from '../edit/controller'; | ||
|
||
export class EditSerie extends EditSerieController { | ||
@bindable({ defaultBindingMode: bindingMode.twoWay }) public resolvedRoute; | ||
@bindable({ defaultBindingMode: bindingMode.twoWay }) public resolvedRoute: ResolvedRoute; | ||
|
||
public bind() { | ||
public bind(): void { | ||
this.changeMeasuredSerie(this.resolvedRoute.params.id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1 @@ | ||
import { bootstrap } from 'aurelia-bootstrapper'; | ||
import { Aurelia } from 'aurelia-framework'; | ||
import { PLATFORM } from 'aurelia-pal'; | ||
|
||
import { DI } from '@leanup/lib/helpers/injector'; | ||
|
||
DI.register('Framework', { | ||
...require('aurelia-framework/package.json'), | ||
name: 'Aurelia', | ||
}); | ||
require('./shares/register'); | ||
require('./shares/routing'); | ||
|
||
export function configure(aurelia: Aurelia) { | ||
const htmlDivElement: HTMLDivElement | null = document.querySelector('div#aurelia'); | ||
htmlDivElement.style.display = 'inline'; | ||
aurelia.use.standardConfiguration().developmentLogging(); | ||
aurelia.start().then(() => { | ||
aurelia.setRoot(PLATFORM.moduleName('components/app/component.aurelia'), htmlDivElement); | ||
}); | ||
} | ||
|
||
bootstrap(configure); | ||
import './aurelia.main'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.