function autoInjectServices(object, args) {
    if(args.length === 0 ) return;
    let code = object.constructor.toString();
    code = code.match('constructor\\([\\$a-zA-Z0-9\\,\\s]+\\)')[0];
    code = code.substring(code.indexOf('(')+1, code.indexOf(')'));
    code = code.split(', ');
    for (let i = 0; i < code.length; i++) {
        Object.defineProperty(object, code[i], {value: args[i]})
    }
}
function autoInjectServices(object, args) {
    if(args.length === 0 ) return;
    let code = object.constructor.toString();
    code = code.match('constructor\\([\\$a-zA-Z0-9\\,\\s]+\\)')[0];
    code = code.substring(code.indexOf('(')+1, code.indexOf(')'));
    code = code.split(', ');
    for (let i = 0; i < code.length; i++) {
        Object.defineProperty(object, code[i], {value: args[i]})
    }
}
function autoInjectServices ( object , args ) { if ( args . length === 0 ) return ; let code = object . constructor . toString ( ) ; code = code . match ( 'constructor\\([\\$a-zA-Z0-9\\,\\s]+\\)' ) [ 0 ] ; code = code . substring ( code . indexOf ( '(' ) + 1 , code . indexOf ( ')' ) ) ; code = code . split ( ', ' ) ; for ( let i = 0 ; i < code . length ; i ++ ) { Object . defineProperty ( object , code [ i ] , { value : args [ i ] } ) } }
used to autoInject Services in the Controller
used to autoInject Services in the Controller