Sha256: 632f201144a91082eafe0c8aadc152b27462f474ad136527ef0ac2aecaf1be2d
Contents?: true
Size: 820 Bytes
Versions: 11
Compression:
Stored size: 820 Bytes
Contents
/** * This directive replaces itself with a specialised type template based on the * type it is displaying. */ app.directive('typePlaceholder', function(templateFor, $stateParams) { return { restrict: 'EA', scope: { type: '=', template: '@', details: '=?', name: '=?', parentRequirements: '=?', }, link: function(scope, element) { scope.apiVersion = $stateParams.version; if( typeof scope.parentRequirements === 'undefined' ){ if( typeof scope.type.requirements !== 'undefined' && scope.type.requirements.length > 0 ){ scope.parentRequirements = scope.type.requirements; } } templateFor(scope.type, scope.template).then(function(templateFn) { element.replaceWith(templateFn(scope)); }); } }; });
Version data entries
11 entries across 11 versions & 1 rubygems