Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor+AngularJs example

I am new to Meteor and AngularJs. I am trying to follow the example app on https://github.com/lvbreda/Meteor_angularjs but I have not been able to get it working so far.

I am getting an error 'app is not defined' in this piece of code:

app.controller('MeteorCtrl', ['$scope', '$meteor', function ($scope, $meteor) {
Uncaught ReferenceError: app is not defined
    $scope.todos = $meteor("todos").find({});
    $meteor("todos").insert({
        name: "Do something",
        done: false
    });

I tried to re-write the above as:

var MeteorCtrl = function ($scope, $meteor) {
    $scope.todos = $meteor("todos").find({});
    $meteor("todos").insert({
        name: "Do something",
        done: false
    })
};

which is still throwing an error 'Error: Unknown provider: $meteorProvider <- $meteor'

The only other example of meter+angularjs at https://github.com/bevanhunt/meteor-angular-leaderboard appears to be dated.

Can someone please post a simple, but fully working, downloadable example of meteor+angularjs using the package at https://github.com/lvbreda/Meteor_angularjs?

like image 523
John Bliss Avatar asked Mar 31 '13 07:03

John Bliss


1 Answers

I'm obviously biased but our team wrote and maintain this library - angular-meteor and we've also released a tutorial for combining the two - angular-meteor tutorial

like image 140
Urigo Avatar answered Oct 14 '22 09:10

Urigo