clone the repositry
git clone git@github.com:tom-muhm/angular-meteor-example.git
-
start the application - so meteroite can download the plugins:
mrt
-
fix the error: Object # has no method 'require' by replacing the first three lines in '.meteor/meteorite/packages/angularjs/server.js' with:
var connect = Npm.require("connect"); var fs = Npm.require("fs"); var path = Npm.require("path"); var Fiber = Npm.require("fibers");
(Note: this error only occurs for the angulurjs plugin v2.0.0 with meteor 0.6+)
-
Start your app with:
mrt
-
open the browser console and add new items with:
angular.element('[ng-controller=MeteorCtrl]').scope().Todos.insert({name: 'Task x'})
-
see the magic happen
-
install meteorite: https://atmosphere.meteor.com/wtf/app
-
create a new app:
mrt create angular-meteor-example && cd angular-meteor-example
-
install the anguluarjs plugin:
mrt add angularjs
-
delete the default html and js files
-
copy the files from my repository 'angular-meteor-example.js' and 'public/angular.html' into your project
-
fix the error: "Object # has no method 'require'" by following step 2. from the setup above
acces meteor service from the browser console:
angular.element('[ng-controller=MeteorCtrl]').injector().get('$meteor') angular.element('[ng-controller=MeteorCtrl]').injector().get('$meteor')('todos').find({})
-