Menu

#108 Does it work in IE8 and angular 1.2.28 without any problems?

open
nobody
None
2016-03-09
2015-09-25
Anonymous
No

Originally created by: vdzundza

Actually, I should use modals with IE8 and I want to know which problems may be occured with it. Thanks.

Discussion

  • Anonymous

    Anonymous - 2016-02-19

    Originally posted by: dwmkerr

    Did you find out @vdzundza ?

     
  • Anonymous

    Anonymous - 2016-03-09

    Originally posted by: unforbidable

    No problems with IE8 specifically it seems but regarding AngularJS 1.2.x I have spotted two issues.

    The first one is that $templateRequest is not available however one might easily use the $http and $templateCache instead, as follows:

          //  Returns a promise which gets the template, either
          //  from the template parameter or via a request to the
          //  template url parameter.
          var getTemplate = function(template, templateUrl) {
            var deferred = $q.defer();
            if (template) {
              deferred.resolve(template);
            } else if (templateUrl) {         
              var cached = $templateCache.get(templateUrl);
              if (cached) {
                deferred.resolve(cached);
              } else {
                $http.get(templateUrl)
                  .then(function(response) {
                    $templateCache.put(templateUrl, response.data);
                    deferred.resolve(response.data);
                  }, function(error) {
                    deferred.reject(error);
                  });
              }
            } else {
              deferred.reject("No template or templateUrl has been specified.");
            }
            return deferred.promise;
          };
    

    The other issue is with $animation.enter() and $animation.leave() as they don't return a promise - instead a callback function is passed as the last parameter. One might need to rewrite the animation finish handler in the close function as follows:

                      //  Let angular remove the element and wait for animations to finish.
                      $animate.leave(modalElement, function () {
                          //  Resolve the 'closed' promise.
                          closedDeferred.resolve(result);
    
                          //  We can now clean up the scope
                          modalScope.$destroy();
    
                          //  Unless we null out all of these objects we seem to suffer
                          //  from memory leaks, if anyone can explain why then I'd
                          //  be very interested to know.
                          inputs.close = null;
                          deferred = null;
                          closeDeferred = null;
                          modal = null;
                          inputs = null;
                          modalElement = null;
                          modalScope = null;
                        });
    
     

Log in to post a comment.