From 400aa549d4157425d9ed7a7bee5788460cb5d9db Mon Sep 17 00:00:00 2001 From: Mike Hartington Date: Tue, 25 Jul 2017 11:28:13 -0400 Subject: [PATCH] feat(generators): refactor generators * feat(generators): update templates * feat(generators): add pipeName to templates --- package.json | 2 +- scripts/templates/page/module.ts.tmpl | 3 --- scripts/templates/page/ts.tmpl | 4 ++-- scripts/templates/pipe/ts.tmpl | 2 +- scripts/templates/tabs/ts.tmpl | 3 ++- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 92857b8bab..bb475088ec 100644 --- a/package.json +++ b/package.json @@ -148,4 +148,4 @@ "pre-push#master": [ "test" ] -} \ No newline at end of file +} diff --git a/scripts/templates/page/module.ts.tmpl b/scripts/templates/page/module.ts.tmpl index 270da9f3df..e47f97a187 100644 --- a/scripts/templates/page/module.ts.tmpl +++ b/scripts/templates/page/module.ts.tmpl @@ -9,8 +9,5 @@ import { $CLASSNAME } from './$FILENAME'; imports: [ IonicPageModule.forChild($CLASSNAME), ], - exports: [ - $CLASSNAME - ] }) export class $CLASSNAMEModule {} diff --git a/scripts/templates/page/ts.tmpl b/scripts/templates/page/ts.tmpl index c2de1f27dd..e308cadcd4 100644 --- a/scripts/templates/page/ts.tmpl +++ b/scripts/templates/page/ts.tmpl @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { NavController, NavParams } from 'ionic-angular'; +$IMPORTSTATEMENT /** * Generated class for the $CLASSNAME page. @@ -7,7 +7,7 @@ import { NavController, NavParams } from 'ionic-angular'; * See http://ionicframework.com/docs/components/#navigation for more info * on Ionic pages and navigation. */ - +$IONICPAGE @Component({ selector: 'page-$FILENAME', templateUrl: '$FILENAME.html', diff --git a/scripts/templates/pipe/ts.tmpl b/scripts/templates/pipe/ts.tmpl index 7d1321d33f..40aa800e19 100644 --- a/scripts/templates/pipe/ts.tmpl +++ b/scripts/templates/pipe/ts.tmpl @@ -7,7 +7,7 @@ import { Pipe, PipeTransform } from '@angular/core'; * Angular Pipes. */ @Pipe({ - name: '$FILENAME', + name: '$PIPENAME', }) export class $CLASSNAME implements PipeTransform { /** diff --git a/scripts/templates/tabs/ts.tmpl b/scripts/templates/tabs/ts.tmpl index be565cef9e..b2563f7332 100755 --- a/scripts/templates/tabs/ts.tmpl +++ b/scripts/templates/tabs/ts.tmpl @@ -1,5 +1,5 @@ import { Component } from '@angular/core'; -import { NavController } from 'ionic-angular'; +$TABS_IMPORTSTATEMENT /** * Generated class for the $CLASSNAME tabs. @@ -7,6 +7,7 @@ import { NavController } from 'ionic-angular'; * See https://angular.io/docs/ts/latest/guide/dependency-injection.html for * more info on providers and Angular DI. */ +$IONICPAGE @Component({ selector: 'page-$FILENAME', templateUrl: '$FILENAME.html'