I'm new to using Angular with Meteor (using angular-with-blaze) and have used AutoForm previously with Blaze.
When creating the autoForm of type="update", an object must be passed in as the doc parameter
{{#autoForm collection="Fruits" id="updateFruit" type="update" doc=fruit}}
...
{{/autoForm}}
Question: How can I pass the document fruit to the autoForm helper? Should I be using Angular controllers or Blaze Template Helpers?
I'm also using ui.router:
$stateProvider
.state('editFruit', {
url: '/editFruit/:fruit_id',
templateUrl: 'client/fruits/views/edit-fruit.ng.html'
})
Update
Attempted to use Blaze's template helpers but it does not seem to be passing the object to the Blaze template. Maybe this feature have not been implemented or maybe my code is incorrect.
Template.updateFruitForm.helpers({
fruit: function () {
var href = window.location.href ;
var fruit_id = href.substr(href.lastIndexOf('/') + 1);
return Fruits.findOne({_id: fruit_id});
}
});