0
votes

We are developing our Mobile part of our meteor app as a package. Since we have mobile and desktop apps, we have a common core package, and the desktop and mobile packages are separate.

So we pretty much have an Angular/Ionic/Cordova/Meteor app inside a package.

The problem we are facing is how do I specify a path to the template. Normally when developing an ionic mobile app normally outside a package it works like

state('manage.prefs', {
   url: '/prefs',
   templateUrl: 'client/views/manage-prefs.html',
   controller: 'ManagePrefsCtrl'
 })

You see templateUrl? That is the path to the .html template that angular uses. Now normally if this was not developed inside a package the route would be relative to root meteor directory.

Since we are developing this as part of a package, the path is not working. We are using api.addFiles to add each template. But how do we get a path to the template? We have tried various paths but none seem to work. Is it possible to get a path to a template inside a package?

We tried api.addAsset which does provide a path but hot reload breaks and it caches all the files so you have to hard reset to make changes appear.

1

1 Answers

2
votes

Short answer:

templateUrl: '/packages/package-name/path-inside-package/manage-prefs.html',

Long answer:

There is now a new tutorial step for that: http://angular-meteor.com/tutorials/angular1/mobile-support-and-packages-isolation