atian25/angular-lazyload

ocLazyLoad

Closed this issue · 4 comments

ocLazyLoad支持 seajs 吗

可以看下官方文档看能否自定义 loader

暂时没有找到. 不知ocLazyLoad 对于angularjs各版本的支持情况如何. 比如1.2(ie8)
同时咨询下大大, seajs + ui-route 有什么好的解决方案建议吗.

看到了你在ocLazyLoad上的提问
how to custom loader at 1.0 ? asyncLoader is gone

不清楚,没用过 ocLazyLoad

发自我的 iPhone

在 2016年11月17日,18:11,virtuecai notifications@github.com 写道:

暂时没有找到. 不知ocLazyLoad 对于angularjs各版本的支持情况如何. 比如1.2(ie8)


You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub, or mute the thread.

看ocLazyLoad源码: jsLoader / cssLoader /templatesLoader

 $provide.decorator('$ocLazyLoad', ["$delegate", "$q", function ($delegate, $q) {
            /**
             * jsLoader function
             * @type Function
             * @param paths array list of js files to load
             * @param callback to call when everything is loaded. We use a callback and not a promise
             * @param params object config parameters
             * because the user can overwrite jsLoader and it will probably not use promises :(
             */
            $delegate.jsLoader = function (paths, callback, params) {
                var promises = [];
                angular.forEach(paths, function (path) {
                    promises.push($delegate.buildElement('js', path, params));
                });
                $q.all(promises).then(function () {
                    callback();
                }, function (err) {
                    callback(err);
                });
            };
            $delegate.jsLoader.ocLazyLoadLoader = true;

            return $delegate;
        }]);