Use systemjs/plugin-text to import html directly to $routeProvider or $templateCache, works great with jspm bundle.
✓ Published0🌍 Public
HHypercubed
Last edited Jul 30, 2015
Created on Jul 30, 2015
This example shows how to load HTML templates as AngularJS module dependencies using SystemJS’s text plugin, avoiding separate HTTP requests. The code demonstrates three approaches: a directive’s `template` property, `$templateCache.put` for reuse, and `$routeProvider.when` for route-specific templates. Each snippet imports the template string via `import somethingHTML from './something.html!text'`, which SystemJS resolves at build time. The examples rely on AngularJS’s dependency injection and SystemJS’s bundle-friendly module loading, making templates directly available in the application’s JavaScript bundle.
AI-generated description