This generator was designed for ionic applications creted using the NEW Yeoman Ionic generator.
The present generator creates a complete ready to use module for your Ionic based Hyrid mobile application project
It will generate the following files under the /app/<module name> folder:
<module name>
├── <module name>.js - Routes
├── <module name>.controller.js - Controller
├── <module name>.html - View
└── <module name>.css - Stylesthe content of the controller file:
"use strict";
angular.module('<app name>')
.controller('ModuleCtrl', function($scope) {
});the content of the router:
"use strict";
angular.module('<app name>')
.config(function($stateProvider) {
$stateProvider
.state('<module name>', {
url: "/<module name>",
templateUrl: "/app/<module name>/<module name>.html",
controller: 'ModuleCtrl'
})
});the content of the view:
<ion-view view-title="<module name>">
<ion-content>
<h1><module name></h1>
</ion-content>
</ion-view>
.css (empty by default)
Additionally it will refere all the newly created files(except for the view file) in the index.html file
First you will have o install the yeoman generator:
npm install -g yothan you will need to install this ionic module generator
To install generator-ionicsubgen from npm, run:
npm install -g generator-ionic-moduleFinally, initiate the generator:
yo ionic-module <app name> <module name>where <app name> is the name of the Angularjs app you are orking on and <module name> is the name of the module you want to create
Djadoun mohamed Abderrezak [email protected]
MIT