Skip to content

Instantly share code, notes, and snippets.

@Adamwaheed
Created March 2, 2016 16:11
Show Gist options
  • Save Adamwaheed/fb46c853bc61fb7e7f1f to your computer and use it in GitHub Desktop.
Save Adamwaheed/fb46c853bc61fb7e7f1f to your computer and use it in GitHub Desktop.
articleView
app.directive('articleView', function(){
return {
template: '',
scope: {
media: '='
},
restrict: 'E',
controller: function($scope) {
$scope.grabTemplate = function() {
if ($scope.media.type == "text")
return "templates/article-text.html";
if ($scope.media.type == "image")
return "templates/article-image.html";
};
}
};
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment