angularIO.directive('ngioCheatsheet', function() { return { controllerAs: '$ctrl', controller: function($http, $attrs, $sce) { var $ctrl = this; $http.get($attrs.src).then(function(response) { $ctrl.currentEnvironment = response.data.currentEnvironment; $ctrl.version = response.data.version; $ctrl.sections = response.data.sections; }); $ctrl.getSafeHtml = function(html) { return $sce.trustAsHtml(html); }; }, template: '

Angular for {{$ctrl.currentEnvironment}} Cheat Sheet (v{{ $ctrl.version.raw }})

' + '
' + '
Loading Cheatsheet...
\n' + '\n' + '\n' + ' \n' + ' \n' + '\n' + '\n' + ' \n' + ' \n' + '\n' + '
{{section.name}}
{{child.syntax}}
' }; });