Adding Angular into an existing Blaze Application


#1

Right, so Angular has some really nice grids/tables in the shape of ng-grid / ui-grid that I want to make use of in my Meteor application, as Meteor seemingly doesn’t have anything quite as nicely integrated, flexible or extensible at present.

So I’ve created an Angular module and a controller for me to setup the grid and manage the $scope data, however I’m struggling to see how I can pass any data into my controller… It’s contained within a Blaze template which obviously has a data context, but I assume that Angular will know nothing about this?

Is the only way to get any data into my controller via Session data? e.g. I have a context where Template.currentData().recipeId is set to an id that I need to query for in my Angular controller;

angular.module('LabelLogicLive').controller('RecipeGridCtrl', ['$scope', function ($scope) {
  $scope.recipe = $meteor.collection(function () {
    return Recipes.findOne({ _id: /* errrrrr..? */ })
  });
}]);

Any ideas / strategies for best dealing with this?