Spin.js
Pure CSS implementation of loading spinners
Saturday, 8 March 2014
Monday, 24 February 2014
Angular Full Stack / Bootstrap / Express setup and dev
Requirements:
- http://yeoman.io/
- sudo npm install -g yo
- sudo npm install -g grunt
- sudo npm install -g grunt-cli
- sudo npm install -g bower
- sudo npm install -g grunt-contrib-imagemin
- https://github.com/yeoman/generator-karma (wasn't included with yo)
- sudo npm install -g generator-karma
- https://github.com/DaftMonk/generator-angular-fullstack
- npm install -g generator-angular-fullstack
Creation process:
- Create a folder, then add scaffolding
- mkdir my-new-project && cd $_
- yo angular-fullstack [app-name]
- Select bootstrap
- Select standard angular modules
- run 'bower install'
- run 'grunt serve'
- This should open up in a browser window to see service running.
Build
- Run 'grunt serve:dist' to dynamically serve production code
- Run 'grunt build' to build app
Adding features
Run yo --help to see a full list. Most common:
Run yo --help to see a full list. Most common:
- yo angular-fullstack:controller <controller name> (excluding Ctrl, this is added for you)
- yo angular-fullstack:view <view name> (excluding .html, i.e. list, creates partials/list.html)
Example
Adding API listing to the app
- yo angular-fullstack:controller ApiList
- Edit it to call the GET /api/apis endpoint
- set $scope.apis to the result
- yo angular-fullstack:view apilist
- Update the view to control the navbar and the result from the api call
<div ng-include="'partials/navbar'"></div>
<div class="row marketing">
<div ng-repeat="api in apis">
<h4>{{api.name}}</h4>
<p>{{api.info}}</p>
</div>
</div> - Edit app/scripts/controllers/navbar and add a new navbar item
{
'title': 'Apis',
'link': '/apiList'
} - Update app/scripts/controllers/apilist.js to call the /api/apis endpoint
- Add another route to the /app/scripts/app.js route provider
- Add API call into lib/routes.js
Adding angular-ui bootstrap
- Add "angular-bootstrap": "0.10.0" to your bower.json file
- bower install
- Update index.html file and add dependency there
- Add the dependency to your module, i.e.
- angular.module('myApp', [..., 'ui.bootstrap'])
Subscribe to:
Posts (Atom)