AngularJS ng-href and svg xlink

后端 未结 7 1526
一向
一向 2020-12-13 17:53

I\'d like some input on using xml namespaced attributes with angular.

The problem is angular comes with a couple of directives to handle writing attributes such as h

7条回答
  •  没有蜡笔的小新
    2020-12-13 18:26

    For anyone else having this problem due to Angular/Angular UI Router in HTML5 mode, I came up with a straightforward fix to enable svg sprite icons to work with their xlink:href attribute and the tag.

    Gist is here: https://gist.github.com/planetflash/4d9d66e924aae95f7618c03f2aabd4a3

    app.run(['$rootScope', '$window', function($rootScope, $window){
     $rootScope.$on('$locationChangeSuccess', function(event){
        $rootScope.absurl = $window.location.href;
    });
    
    
    

提交回复
热议问题