Skip to content

Instantly share code, notes, and snippets.

@rbinsztock
Last active September 12, 2016 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rbinsztock/e3173aaa23e52e32cd3efd10fac689eb to your computer and use it in GitHub Desktop.
Save rbinsztock/e3173aaa23e52e32cd3efd10fac689eb to your computer and use it in GitHub Desktop.
import fooTemplate from './foo.html';
import barTemplate from './bar.html';
app.directive('dyntemplate', function() {
return {
templateUrl: function(elem, attrs) {
if (attrs.templateUrl === 'foo.html') {
return fooTemplate;
}
return barTemplate;
}
};
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment