angularjs Error: [$compile:tpload] Failed to load template

前端 未结 4 903
谎友^
谎友^ 2021-01-05 02:50

I am trying to build simple routing app in angularjs. I have main index.html page with ng-view div and javascript code for routing. Also 2 simple html pages view2.html and v

4条回答
  •  猫巷女王i
    2021-01-05 03:34

    Error: [$compile:tpload] Failed to load template: xyz.html (HTTP status: 404 Not Found)
    

    can be caused by below setting in web.config

     
        
          
          
    

    This causes to block any direct request to the file in Views directory. Angular xhr request to this file is blocked by this.

    Comment it out and see if things work. Use this with caution as it allows access to your files.

    You can also check on this url for more responses: Error: $compile:tpload failed to load template Http status : 404

提交回复
热议问题