Skip to content

Instantly share code, notes, and snippets.

@yannbf
Created October 11, 2017 02:50
Show Gist options
  • Save yannbf/3f902d7d2cd2525f6ed5fbfe5249b80c to your computer and use it in GitHub Desktop.
Save yannbf/3f902d7d2cd2525f6ed5fbfe5249b80c to your computer and use it in GitHub Desktop.
#!/bin/sh
PAGE=${1}Page
FILE=$(echo "$1" | sed 's/[A-Z]/-\l&/g;s/.//')
cat << EOF >${FILE}.module.ts
import { $PAGE } from './$FILE';
import { NgModule } from '@angular/core';
import { IonicPageModule } from 'ionic-angular';
@NgModule({
declarations: [
$PAGE,
],
imports: [
IonicPageModule.forChild($PAGE),
],
exports: [
$PAGE
]
})
export class ${PAGE}Module { };
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment