angularIO.directive('ngioCheatsheet', function() { return { restrict: 'E', scope: {}, controllerAs: '$ctrl', controller: function($http, $attrs, $sce) { var $ctrl = this; $http.get($attrs.src).then(function(response) { if ($attrs.hasOwnProperty('versionOnly')) { $ctrl.version = response.data.version.raw; } else { $ctrl.sections = response.data.sections; } }); $ctrl.getSafeHtml = function(html) { return $sce.trustAsHtml(html); }; }, template: '{{$ctrl.version}}' + '
{{section.name}} | \n' + '\n' + ' |
---|---|
{{child.syntax}} | \n' +
' \n' + ' |