@@ -32,12 +32,6 @@ module openflow {
3232 this . gettoken ( ) ;
3333 // cleanup();
3434 } ) ;
35- // var cleanup2 = this.$rootScope.$on('cordovadetected', (event, data) => {
36- // if (event && data) { }
37- // console.log("cordovadetected, reload token");
38- // this.gettoken();
39- // cleanup2();
40- // });
4135 [ 'log' , 'warn' , 'debug' , 'error' ] . forEach ( ( methodName ) => {
4236 //['error2'].forEach((methodName) => {
4337 const originalMethod = console [ methodName ] ;
@@ -325,12 +319,12 @@ module openflow {
325319 }
326320 export class JSONfn {
327321 public static stringify ( obj ) {
328- return JSON . stringify ( obj , function ( key , value ) {
322+ return JSON . stringify ( obj , function ( key , value ) {
329323 return ( typeof value === 'function' ) ? value . toString ( ) : value ;
330324 } ) ;
331325 }
332326 public static parse ( str ) {
333- return JSON . parse ( str , function ( key , value ) {
327+ return JSON . parse ( str , function ( key , value ) {
334328 if ( typeof value != 'string' ) return value ;
335329 return ( value . substring ( 0 , 8 ) == 'function' ) ? eval ( '(' + value + ')' ) : value ;
336330 } ) ;
@@ -383,7 +377,7 @@ module openflow {
383377 return new Promise ( ( resolve ) => {
384378 try {
385379 if ( locale === null || locale === undefined ) { return resolve ( ) ; }
386- locale . ready ( lib ) . then ( function ( ) {
380+ locale . ready ( lib ) . then ( function ( ) {
387381 var value = locale . getString ( lib + "." + key ) ;
388382 if ( value !== null && value !== undefined && value !== "" ) {
389383 resolve ( value ) ;
@@ -425,15 +419,15 @@ module openflow {
425419 this . locale . ready ( lib ) . then ( ( ) => {
426420 var value : string = null ;
427421 if ( ngModelCtrl !== null ) {
428- ngModelCtrl . $formatters . push ( function ( value ) {
422+ ngModelCtrl . $formatters . push ( function ( value ) {
429423 return calculateValue ( value ) ;
430424 } ) ;
431425 // value = calculateValue(ngModelCtrl.$viewValue);
432426 // ngModelCtrl.$setViewValue(this.result);
433427 // ngModelCtrl.$render();
434428 } else {
435429 var hashCode = ( s : string ) => {
436- return s . split ( "" ) . reduce ( function ( a , b ) { a = ( ( a << 5 ) - a ) + b . charCodeAt ( 0 ) ; return a & a } , 0 ) ;
430+ return s . split ( "" ) . reduce ( function ( a , b ) { a = ( ( a << 5 ) - a ) + b . charCodeAt ( 0 ) ; return a & a } , 0 ) ;
437431 }
438432 var watchFunction = ( ) => {
439433 if ( attr . value !== null && attr . value !== undefined ) {
@@ -542,7 +536,7 @@ module openflow {
542536 async DeleteOne ( model : any ) : Promise < any > {
543537 this . loading = true ;
544538 await this . api . Delete ( this . collection , model ) ;
545- this . models = this . models . filter ( function ( m : any ) : boolean { return m . _id !== model . _id ; } ) ;
539+ this . models = this . models . filter ( function ( m : any ) : boolean { return m . _id !== model . _id ; } ) ;
546540 this . loading = false ;
547541 if ( ! this . $scope . $$phase ) { this . $scope . $apply ( ) ; }
548542 }
0 commit comments