All Projects → previousdeveloper → ionic-best-structure

previousdeveloper / ionic-best-structure

Licence: MIT license
Clean code for ionic project.

Programming Languages

javascript
184084 projects - #8 most used programming language
CSS
56736 projects
HTML
75241 projects

ionic-best-template

  • Define 1 component per file.

The following example defines the app module and its dependencies, defines a controller, and defines a factory all in the same file.

/* recommended */

// app.module.js
angular
    .module('app', ['ngRoute']);
/* recommended */

// ChatDetailCtrl.js
angular
    .module('app')
    .controller('ChatDetailCtrl', ChatDetailCtrl);

function ChatDetailCtrl() { }
/* recommended */

// someFactory.js
angular
    .module('app')
    .factory('Chats', chatDetailService);

function chatDetailService() { }

###Separate file structure

 ```

/www /js /account /controller /account.controller.js /service /account.service.js /config.js index.html ```

##For browser
 ```
$ ionic serve
```

##For android
```
$ ionic platform add android
$ ionic build android
$ ionic emulate android
```

##For ios
```
$ ionic platform add ios
$ ionic build ios
$ ionic emulate ios
 ```
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].