F
F
faragly2015-05-04 23:01:48
JavaScript
faragly, 2015-05-04 23:01:48

What is the equivalent of jQuery.globalEval in AngularJS?

Hello! I'm sure that there is, poke your finger ... $ eval seems to be there, but if you register it, it gives an error, apparently you need to connect it. Tell me please

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Roman Zhak, 2015-05-04
@faragly

It is possible to add such a service in angular

// from jQuery lib
globalEval: function( data ) {
    if ( data && rnotwhite.test( data ) ) {
        // We use execScript on Internet Explorer
        // We use an anonymous function so that context is window
        // rather than jQuery in Firefox
        ( window.execScript || function( data ) {
            window[ "eval" ].call( window, data );
        } )( data );
    }
}

S
Sergey, 2015-05-04
Protko @Fesor

There are no analogues. And $eval is a bit different.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question