Created
March 2, 2016 16:11
-
-
Save Adamwaheed/fb46c853bc61fb7e7f1f to your computer and use it in GitHub Desktop.
articleView
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
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