Reputation: 53526
I am learning Meteor and I'm trying to add internationalization support with the tap:18n
package. Unfortunately, the template helper function _
is not availble inside Angular modules. For example
<div>{{_ "foo"}}</div>
works, but does not when using it inside a module template :
<div ng-app="app" ng-include="'foo.ng.html'">
<div ng-app="bar">
<div>{{_ "bar"}}</div>
</div>
note: app
is declared inside foo.js
as angular.module('app', ['angular-meteor']);
, in the project root level.
Is it possible to make helpers available inside Angular modules?
(note: see referenced issue.)
Same thing happens when trying to render package templates inside another template :
<section ng-app="users"
ng-include="'users/usersession.ng.html'">
</section>
<ul class="nav navbar-nav navbar-right">
{{> loginButtons}} <!-- here -->
</ul>
Then I get Syntax Error: Token '>' not a primary expression at column 1 of the expression [> loginButtons] starting at [> loginButtons]
.
Note: the module users
is defined and everything works fine without the {{> loginButtons}}
expression.
Upvotes: 2
Views: 849
Reputation: 1405
You can use meteor templates inside angular. Try something like:
<meteor-include src="myTemplate"></meteor-include>
Your template would be something like:
<template name="myTemplate">
<div>{{_ "foo"}}</div>
</template>
Remember when naming .html files, the angular templates will be name.ng.html and the meteor templates will just be name.html
Upvotes: 2