https://github.com/previousdeveloper/ionic-best-structure
Clean code for ionic project.
https://github.com/previousdeveloper/ionic-best-structure
Last synced: 3 months ago
JSON representation
Clean code for ionic project.
- Host: GitHub
- URL: https://github.com/previousdeveloper/ionic-best-structure
- Owner: previousdeveloper
- License: mit
- Created: 2015-06-02T19:09:00.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-06-07T16:59:03.000Z (almost 10 years ago)
- Last Synced: 2025-01-31T14:17:03.332Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.63 MB
- Stars: 10
- Watchers: 2
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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.
```javascript
/* recommended */// app.module.js
angular
.module('app', ['ngRoute']);
``````javascript
/* recommended */// ChatDetailCtrl.js
angular
.module('app')
.controller('ChatDetailCtrl', ChatDetailCtrl);function ChatDetailCtrl() { }
``````javascript
/* 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
```