javascript - angular中使用多说的分享模块,切了route以后动态加载多说的CSS,JS无效?
巴扎黑
巴扎黑 2017-04-10 14:59:27
[JavaScript讨论组]
    (function() {
        var ds = document.createElement('script');
        ds.type = 'text/javascript';ds.async = true;
        ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
        ds.charset = 'UTF-8';
        (document.getElementsByTagName('head')[0] 
         || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();

这是route配置

    laughApp.config(['$routeProvider',function($routeProvider) {
    $routeProvider.
      when('/text', {
        templateUrl : 'partials/text.html',
        controller  : 'TextListCtrl'
      }).
      when('/comic', {
        templateUrl : 'partials/comic.html',
        controller  : 'ComicListCtrl'
      }).
      when('/img',{
        templateUrl : 'partials/img.html',
        controller  : 'imgCtrl'
      }).
      otherwise({
        redirectTo : '/text'
      });

}]);

引入多说分享组件的模块

    
  • {{text.Title}}

    {{text.Data}}

  • 另外一个view也跟这个类似,但是第一次加载刷新的起左右,切了ngView以后就分享就不响应了。求解答!~

    巴扎黑
    巴扎黑

    全部回复(0)
    热门教程
    更多>
    最新下载
    更多>
    网站特效
    网站源码
    网站素材
    前端模板
    关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新
    php中文网:公益在线php培训,帮助PHP学习者快速成长!
    关注服务号 技术交流群
    PHP中文网订阅号
    每天精选资源文章推送

    Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号