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?

While I'm not using lvbreda's Angular package, I have been able to integrate Angular with Meteor + Blade as the HTML templating language, in a relatively simple way. I started off with Daniel Olano's Ng-Meteor package, and ended up with my own implementation of a Meteor/Angular bridge. I'm new to both Meteor and Angular, but it appears to work well and I like that the code is very transparent so that I understand pretty well how it works.

I've written the following CoffeeScript module, named client/ngMeteor.coffee, which defines the bridge between Meteor and Angular:

define("ngMeteor", [], ->
  angular.module('ngMeteor.directives', [])

  angular.module('ngMeteor.services', [])

  angular.module('ngMeteor.blade', []).run(['$templateCache', '$rootScope', '$compile',
    ($templateCache, $rootScope, $compile) ->
      bodyTemplate = Template.body
      if !bodyTemplate
        throw new Error("A body template must be defined ('body.blade')")

      # Render each template and place in Angular's template cache
      $templateCache.put "#{key}.blade", render() for own key, render of Template

      # Render the body template and have Angular compile it, then inject it into the DOM's body element
      Meteor.startup(()->
        # Necessary?
        Spark.finalize(document.body)
        $('html').attr('data-ng-app', '')
        $('body').html($compile(bodyTemplate())($rootScope))
        $rootScope.$apply()
      )
  ])
  angular.module 'ngMeteor', ['ngMeteor.blade', 'ngMeteor.services', 'ngMeteor.directives']
)

For a full working example see this example project of mine. Feedback is appreciated.

I just created a simple example which shows how to create a simple angular-meteor application.

The app displays some items from a mongo collection and can update the collection through the browser-console in realtime. (just default meteor features with angular-js)

It can be found on github: https://github.com/tom-muhm/angular-meteor-example.

You can find some examples in a different fork https://github.com/alex-okrushko/Meteor_angularjs

I build an app in https://github.com/linepos/linepos but now it's not working because lvbreda changed the code

There is a different approach you can use https://github.com/kievechua/flame-on

Just had the same problem. Solved by adding meteor dependency

angular.module('meteorapp', ["meteor"]) # <------------------- Here
.config ['$routeProvider', '$locationProvider', ($routeProvider, $locationProvider) ->
  $locationProvider.html5Mode(true)
  $routeProvider.when '/',
   controller: 'home'
]

I am also new to Meteor and Angular - and I also had a hard time to make this work. But I think I managed to get the basic Angular functionality running.

What I found out I put onto github: https://github.com/dirkk0/angularjs-meets-meteorjs

I hope this works for you, too.

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

I've been going at this problem myself and made a package for angural. example code is at: https://github.com/bramtervoort/meteor-angular-stack/tree/example example at: http://bramtervoort-todo.meteor.com

Its very simple just install meteor and run: mrt add angular-stack