A Framework for WebView Applications in AngularJS
To address issues or request additional functionality, please use the issues tab associated with this repo. Build includes ngRoute and ngTouch modules for AngularJS. If you choose to scaffold an application that is not for web, you will be prompted to install phonegap.
npm install [-g] angularjs-groovy
bower install angularjs-groovy --save-dev
groovy <app name> <desired location>
and then follow the prompts. Examples use the boilerplate.
<script type='text/javascript'>
groovy = {
forWeb: false,
useLogin: false,
header: {
title: 'Groovy',
color: 'Emerald Cove'
},
masterDetail: {
iconUrl: 'images/appbar.nyan.svg'
}
};
</script>
More details on each option are included below.
<script type='text/javascript'
src='bower_components/angularjs/angular.js'>
</script>
<script type='text/javascript'
src='bower_components/angularjs-groovy/dist/angularjs-groovy.js'>
</script>
Or wherever your Bower components install.
<ng-view></ng-view>
angular.module('groovyApp', [
'angularjs-groovy'
]);
inside of your own JavaScript. Doing the above will create a templated master-detail application.
<div ng-controller='yourCtrl'
ng-groovy-view
ng-groovy-view-name='settings'
ng-groovy-view-icon-url='iconUrl'
ng-groovy-view-options='{ prependHTML: true }'>
HTML
</div>
Check the examples to determine how these views appear. They can also be nested inside other views as directives.
An attribute representing options on the view is also available (similar to ngModelOptions) with the following options:
Key | Type | Definition | Default |
---|---|---|---|
appName | string | Adds your application name to the title of the page | undefined |
forWeb / fW | boolean | Is this application intended to be used for the web or as a native application? | true |
useLogin / uL | boolean | Instantiates a view for login, controlled by user reference | false |
useStyle | boolean | Use bootstrap/drunken pirate/groovy css | true |
header / h | object | undefined | |
header.title | string | Application header content | undefined |
header.color | string | Options: 'Lagoon, Strawberry, Banana, Bruise, Emerald Cove, Nassau Sunset' | undefined |
header.templateUrl | string | An html file to use en lieu of the default API header template | undefined |
type | string | Options: masterDetail (mD), tabbed (t), pageBased (pB), singleView (sV) | 'sV' |
masterDetail / mD | object | undefined | |
masterDetail.iconUrl | string | An image file to use en lieu of the default API master detail icon | undefined |
masterDetail.templateUrl | string | An html file to use en lieu of the default API master detail template | undefined |
tabbed / t | object | undefined | |
tabbed.templateUrl | string | An html file to use en lieu of the default API page based template | undefined |
pageBased / pB | object | undefined | |
pageBased.templateUrl | string | An html file to use en lieu of the default API page based template | undefined |
color | string | Options: 'Lagoon, Strawberry, Banana, Bruise, Emerald Cove, Nassau Sunset' | undefined |
debug | boolean | Enables AngularJS debug statements for Groovy | false |