Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/364.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript angularjs模式不显示外部html文件中的模式内容_Javascript_Jquery_Angularjs_Twitter Bootstrap - Fatal编程技术网

Javascript angularjs模式不显示外部html文件中的模式内容

Javascript angularjs模式不显示外部html文件中的模式内容,javascript,jquery,angularjs,twitter-bootstrap,Javascript,Jquery,Angularjs,Twitter Bootstrap,我在一个外部HTML文件中有一个模式,我尝试将其作为我的templateUrl加载到我的App controller中,但该模板没有显示,并且在我的控制台中没有给出任何错误 这是我的控制器文件 app.controller('seCtrl', ['$scope', '$http', '$uibModal', function($scope,$http,$uibModal,$log){ $scope.openmod = function (){ console.log("modal

我在一个外部HTML文件中有一个模式,我尝试将其作为我的templateUrl加载到我的App controller中,但该模板没有显示,并且在我的控制台中没有给出任何错误

这是我的控制器文件

app.controller('seCtrl', ['$scope', '$http', '$uibModal',   function($scope,$http,$uibModal,$log){

$scope.openmod = function (){
    console.log("modal clicked");
    var modalInstance = $uibModal.open({
         //template: "<div ng-include src=\"'./assets/partials/sec-modals.html'\"></div>",
         templateUrl: './assets/partials/sec-modals.html',
          // windowTemplateUrl: './assets/partials/sec-modals.html',
        controller: 'secmodalCtrl', 
        resolve: {}
    });
};

}])
app.controller('seCtrl'、['$scope'、'$http'、'$uibModal',函数($scope、$http、$uibModal、$log){
$scope.openmod=函数(){
console.log(“模态单击”);
var modalInstance=$uibModal.open({
//模板:“”,
templateUrl:“./assets/partials/sec modals.html”,
//windowTemplateUrl:“./assets/partials/sec modals.html”,
控制器:“secmodalCtrl”,
解析:{}
});
};
}])
这是我的sec-modals.html

<div id="modal">
 <h1>welcome to the modal</h1>
</div>

欢迎来到莫代尔
请注意,我已经尝试使用ng include、windowsTemplateUrl,但不起作用
我将非常感谢您的帮助

听起来好像找不到模板。你确定路径正确吗?是的,我非常确定你浏览器的网络控制台。应该有对该模板的请求。请确保解析的路径正确。我可以在浏览器的网络控制台上看到请求,它可能只是模板的格式。它应该具有类为“模态头”、“模态体”等的元素。请参见此处的示例代码~