WARNING: Tried to load angular more than once. when I include JQuery

后端 未结 8 1659
暖寄归人
暖寄归人 2020-12-01 21:58

I am building an yeoman app with an angular-generator.

The js libraries included in my index.html file are:



        
相关标签:
8条回答
  • 2020-12-01 22:29

    This happened to me too with .NET and MVC 5 and after a while I realized that within the label: ngview

    again included as section scripts happens to you. To solve the problem on the server side what I do is return the partial view. Something like:

    public ActionResult Index()
    {
        return View();
    }
    
    public ActionResult Login()
    {
        return PartialView();
    }
    
    public ActionResult About()
    {
        return PartialView();
    }
    
    0 讨论(0)
  • 2020-12-01 22:29

    I was getting the same warning and it was because of the order of the files included, as well as the version used.

    To resolve the above warning , I re-included the files in the following order:

    jquery.js
    jqueryui.js
    angular.js
    

    Note: You have to add jquery script tag before angularjs so that angularjs can replace jqLite by jQuery.

    Moreover, my code was working with AngularJS v1.2.0, but not with a higher angular version. So check for your jquery and angularjs version compatibility as well.

    0 讨论(0)
提交回复
热议问题