'use strict' ; declare const Zone ; let $$injector ; export let getDeps = ( name ) => { if ( $$injector ) { return $$injector . get ( name ) ; } else { return angular . noop ; } } ; export const inject = ( services ) => { if ( ! services || ! services . length ) { return ; } let service ; return function ( Target ) { angular . module ( 'teambition' ) . run ( [ '$injector' , ( $injector ) => { $$injector = $injector ; angular . forEach ( services , ( name , index ) => { try { service = $injector . get ( name ) ; Target . prototype [ name ] = service ; } catch ( error ) { console . error ( error ) ; } } ) ; } ] ) ; } ; } ; export function parentView ( name ) { return function ( TargetView ) { TargetView . prototype . parentName = name ; } ; } export const getParam = ( search , name ) => { if ( ! search || ! name ) { return '' ; } else { let _name = name . replace ( /[\[]/ , '\\[' ) . replace ( /[\]]/ , '\\]' ) ; let regex = new RegExp ( '[\\?&]' + _name + '=([^&#]*)' ) ; let params = '?' + search . split ( '?' ) [ 1 ] ; let results = regex . exec ( params ) ; if ( ! results ) { return '' ; } else { return decodeURIComponent ( results [ 1 ] . replace ( /\+/g , ' ' ) ) ; } } } ; export const rootZone = Zone . current . fork ( { name : 'root-zone' } ) ;