nl_tokens: @ngdoc method @name ng . $sceDelegate#trustAs @methodOf ng . $sceDelegate
pl_tokens: function trustAs ( type , trustedValue ) { var constructor = ( byType . hasOwnProperty ( type ) ? byType [ type ] : null ) ; if ( ! constructor ) { throw $sceMinErr ( 'icontext' , 'Attempted to trust a value in invalid context. Context: {0}; Value: {1}' , <mask> , trustedValue ) ; } if ( trustedValue === null || trustedValue === undefined || trustedValue === '' ) { return trustedValue ; } // All the current contexts in SCE_CONTEXTS happen to be strings.  In order to avoid trusting // mutable objects, we ensure here that the value passed in is actually a string. if ( typeof trustedValue !== 'string' ) { throw $sceMinErr ( 'itype' , 'Attempted to trust a non-string value in a content requiring a string: Context: {0}' , type ) ; } return new constructor ( trustedValue ) ; }