angular.module('myApp', ['ionicModuleOrWhatever'])
.controller('ClockInController', ['$ionicHistory', function ($ionicHistory) {
// Do something with $ionicHistory
}]);
I figured this out with the link you provided: http://errors.angularjs.org/1.3.0/$injector/unpr?p0=%24ionicHistoryProvider%20%3C-%20%24ionicHistory. Documentation can be a bit dense but it was the first line
update: you mentioned you copied the code from github, I found your issue. Instead of cloning you must have copied the file you thought you were supposed to - but you copied the wrong file.
Due to your error Uncaught ReferenceError: IonicModule is not defined, localhost:8100/js/history.js, Line: 19
-- That file has The following lines 19&20:
IonicModule
.factory('$ionicHistory', [
To me, this looks like coffeescript, which is not compiled. The file you copied was not the release version of the file. You need this file, instead. The ionic github project contains a gulpfile, which means they are using a build tool. Likely you had copied the file that is used to generate the release version of the file, instead of the release version of the file. In projects like this that contain either a gulpfile or gruntfile, check for a /dist/
directory, a /dest/
directory, a release
directory, or a build/
directory and instead copy the file from there. You can also copy the .min.js
version of the file if you don't plan on modifying the $ionicHistory source code.