0
votes

I have a working AngularJS project and I have recently started working with an Open Source project written in Meteor-Blaze. I understand that AngularJS can be used in meteor instead of blaze, as described here.

What I would like to do is allow my fairly simple Angular project to be loaded within the Meteor-Blaze project without forcing navigation to a new site. The problem is that everything I've read seems to suggest that if I want Angular to work within Meteor I need to remove Blaze from my project first.

I believe I have found instructions to do the opposite, i.e. hosting a Blaze template inside an Angular project here.

Is this something that's possible? I realize the best solution would likely be to rewrite my Angular Project in Blaze, but I'd prefer to avoid that for now, even if its not a perfect solution.

For a little more clarification around what I'm trying to do: The Meteor-Blaze project is using a kadira:flow-router to set a section of the page to specific Blaze templates using: {{pathFor 'myLink'}}. This is used after setting them with FlowRouter.route(). What would be ideal is being able to display my angular application using this same "FlowRouter", however I don't think its quite that simple and I'm open to other suggestions.

1

1 Answers

0
votes

I've solved this problem by using the Meteor/Public folder. By dropping my app there meteor now ignores the files and will load them as a static asset from your root directory.

From there it was simple, I created a template containing an iframe which simply loads my angular project:

<template name="dummypage">
  <iframe style="height:100%; width:100%" src="/my_angular_app/index.html"></iframe>
</template>

and then I route to it using FlowRouter:

FlowRouter.route('/dummypage');

Note: I'm sure there a variety of ways to load the dummypage template other than using FlowRouter, but this is what worked for my use case.