You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MatthewVita edited this page Dec 31, 2014
·
2 revisions
Q: How do I specify a template in Angular UI Router?
Regardless of markup type (e.x.: Jade or HTML), templates are stored in Angular's $templateCache. Rupert intelligently stores the template as based off of the template's relative 'feature' directory name via a <dir>/<component name>-template.<ext> format.
Once Rupert is installed, ensure the Angular toolkit is in place:
npm install --save rupert-config-angular
Add the UI Router dependency to /src/client/main.js (it is built into the Rupert Angular install as the default router/state machine):
angular.module('rupert-app',['ui.router']);
Add the UI Router view directive to /src/client/index.html (default index is in Jade markup):
...
<body><ui-view></ui-view>
...
Create a test feature directory (/src/client/foo) with a bar-template.html therein:
<h1>{{baz}}</h1>
Appropriately reference the template in /src/client/main.js: