Home     RSSRSS

Yo + Angular + Cordova = Yay!

December 12, 2013 by Brian | 2 Comments | Filed in work

Starting with Daniel Simard’s awesome grunt-angular-phonegap, I was able to get a Hello World (aka ‘Allo ‘Allo) cordova base app running on my Android simulator without much trouble. It didn’t quite work out of the box, and I am not sure yet how to contribute back, but until I figure that out, I thought I would share what I did to get things going.

  cordova platform add android
 

To get ‘grunt serve’ to work, I had to copy platforms/android/assets/cordova*.js to app/

  cp platforms/android/assets/www/cordova*.js app/
 

In Gruntfile.js, in the ‘build’ step, I commented out the ‘cdnify’ task which forces the app to load jquery from google’s CDN instead of locally.

Added <script src=”cordova.js”></script> above the inclusion of jquery.js in app/index.html

Created script/fscordova.js, from http://www.ng-newsletter.com/posts/angular-on-mobile.html#native

Added <script src=”scripts/fscordova.js”></script>above the inclusion of app.js

Added fsCordova’ to things to inject in app.js after ‘ngRoute’.

Listen to cordova ready within scripts/controller/main.js

angular.module(‘myappApp’)
.controller(‘MainCtrl’, function ($scope, CordovaService) {

CordovaService.ready.then(function() {
  //console.log("CORDOVA IS READY ———–");
  $(‘.text-muted’).html("Woot Woot!"); //yes it’s jQuery… shoot me!
});

$scope.awesomeThings = [
  ‘HTML5 Boilerplate’,
  ‘AngularJS’,
  ‘Karma’
];
});

Now you can run

  grunt phonegap:build serve

and more importantly:

  grunt phonegap:build phonegap:emulate && platforms/android/cordova/log

 

Enjoy!

Screen Shot 2013-12-12 at 11.29.10 PM

Don’t use register.com

December 11, 2013 by Brian | 1 Comment | Filed in work

If you try to renew your domain name on register.com it costs $38. If you click the button to transfer it to another company, they offer you the renewal price of $10.

So frickin slimy, but I am lazy and probably will just pay the $10 and stay there. If you need a domain, go to http://namecheap.com/, that’s where most of mine are