ng-Include is very slow with the external template

前端 未结 2 1138
梦如初夏
梦如初夏 2021-01-17 01:28

I have used ng-include as shown below.But it is very slow.In other words it shows tab\'s heading without the content of it.Later it loads the content.Which is r

2条回答
  •  旧时难觅i
    2021-01-17 02:13

    Here is the solution.You can use $templateCache service.

    app.js

    appModule.run(["$templateCache", "$http", function ($templateCache, $http) {
        $http.get('~/App/tenant/views/propertymanagement/tabs/createPropertyForm.cshtml', { cache: $templateCache });
    
    }]);
    

    cshtml page

      

提交回复
热议问题