mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-26 08:13:34 +08:00
chore(templates): update generator templates
This commit is contained in:
@ -4,6 +4,5 @@
|
||||
See https://angular.io/docs/ts/latest/api/core/index/ComponentMetadata-class.html
|
||||
for more info on Angular 2 Components.
|
||||
-->
|
||||
<div>
|
||||
{{text}}
|
||||
</div>
|
||||
|
||||
{{text}}
|
||||
|
@ -1,3 +1,3 @@
|
||||
.$FILENAME {
|
||||
$FILENAME {
|
||||
|
||||
}
|
||||
|
@ -15,6 +15,8 @@ export class $CLASSNAME {
|
||||
text: string;
|
||||
|
||||
constructor() {
|
||||
console.log('Hello $CLASSNAME Component');
|
||||
this.text = 'Hello World';
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -10,7 +10,9 @@ import { Directive } from '@angular/core';
|
||||
selector: '[$FILENAME]' // Attribute selector
|
||||
})
|
||||
export class $CLASSNAME {
|
||||
|
||||
constructor() {
|
||||
console.log('Hello World');
|
||||
console.log('Hello $CLASSNAME Directive');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
.$FILENAME {
|
||||
page-$FILENAME {
|
||||
|
||||
}
|
||||
|
@ -8,12 +8,15 @@ import { NavController } from 'ionic-angular';
|
||||
Ionic pages and navigation.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'page-$FILENAME',
|
||||
templateUrl: '$FILENAME.html'
|
||||
})
|
||||
export class $CLASSNAME {
|
||||
|
||||
constructor(private navCtrl: NavController) {
|
||||
constructor(public navCtrl: NavController) {}
|
||||
|
||||
ionViewDidLoad() {
|
||||
console.log('Hello $CLASSNAME Page');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -11,7 +11,8 @@ import 'rxjs/add/operator/map';
|
||||
@Injectable()
|
||||
export class $CLASSNAME {
|
||||
|
||||
constructor(private http: Http) {
|
||||
constructor(public http: Http) {
|
||||
console.log('Hello $CLASSNAME Provider');
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1,3 +1,3 @@
|
||||
.$FILENAME {
|
||||
page-$FILENAME {
|
||||
|
||||
}
|
||||
|
@ -3,17 +3,21 @@ import { NavController } from 'ionic-angular';
|
||||
$TAB_IMPORTS
|
||||
|
||||
/*
|
||||
Generated class for the $CLASSNAME provider.
|
||||
Generated class for the $CLASSNAME tabs.
|
||||
|
||||
See https://angular.io/docs/ts/latest/guide/dependency-injection.html
|
||||
for more info on providers and Angular 2 DI.
|
||||
*/
|
||||
@Component({
|
||||
selector: 'page-$FILENAME',
|
||||
templateUrl: '$FILENAME.html'
|
||||
})
|
||||
export class $CLASSNAME {
|
||||
|
||||
$TAB_VARIABLES
|
||||
|
||||
constructor(public navCtrl: NavController) {}
|
||||
constructor(public navCtrl: NavController) {
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user