Last active
June 3, 2016 16:01
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import somethingHTML from './something.html!text'; | |
angular.module('myApp',[]) | |
.directive('myDirective', function() { | |
return { | |
template: somethingHTML | |
} | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import somethingHTML from 'components/something/something.html!text'; | |
angular.module('myApp',[]) | |
.run(function($templateCache) { | |
$templateCache.put('components/something/something.html', somethingHTML); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import somethingHTML from 'components/something/something.html!text'; | |
angular.module('myApp',[]) | |
.config(function($routeProvider) { | |
$routeProvider | |
.when('/something', { | |
template: somethingHTML, | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
they are all different examples of the same thing