Skip to content

Instantly share code, notes, and snippets.

@Hypercubed
Last active June 3, 2016 16:01
Show Gist options
  • Save Hypercubed/356e5f9cb356bfdfa721 to your computer and use it in GitHub Desktop.
Save Hypercubed/356e5f9cb356bfdfa721 to your computer and use it in GitHub Desktop.
Use systemjs/plugin-text to import html directly to $routeProvider or $templateCache, works great with jspm bundle.
import somethingHTML from './something.html!text';
angular.module('myApp',[])
.directive('myDirective', function() {
return {
template: somethingHTML
}
});
import somethingHTML from 'components/something/something.html!text';
angular.module('myApp',[])
.run(function($templateCache) {
$templateCache.put('components/something/something.html', somethingHTML);
});
import somethingHTML from 'components/something/something.html!text';
angular.module('myApp',[])
.config(function($routeProvider) {
$routeProvider
.when('/something', {
template: somethingHTML,
})
});
@forestjohnsonpeoplenet
Copy link

they are all different examples of the same thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment