Forked from zachlysobey/ng-directive-inline-multi-line-template-string.es6.js
Last active
February 26, 2016 04:14
-
-
Save limweb/71fc5dbb5e7dd7ae3fbd to your computer and use it in GitHub Desktop.
Angular 1 Directive with ES6 Multi-line string template inline.
This file contains 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
(function() { | |
'use strict'; | |
angular | |
.module('myModule') | |
.directive('myDirective', myDirective); | |
const template = ` | |
<div class="my-directive-template"> | |
<h1>Using multi-line Strings for templates</h1> | |
<p> | |
Of course, this will currently only work | |
when transpiling the ES6 code to ES5 with | |
something like Babel | |
</p> | |
</div> | |
`; | |
function myDirective() { | |
return { | |
template: template, | |
restrict: 'E' | |
}; | |
} | |
}()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment