我正在使用约曼/发电机-咕噜角系统编译一个角度应用程序,我对它做了一些修改,以适应与另一个应用程序共享的代码。“发布模式”是将所有模板编译到javascript中,以便立即加载所有内容。如果我引用一个模板,如下所示:
<div ng-include="'components/navbar/navbar.html'" />
<div class="row">
<div class="large-4 columns">
<h3>Your Courses</h3>
<div ng-include="'components/courses/course-list.html'" ng-controller="MyCoursesCtrl" />
<form id="fileupload"
data-url="http://api.orienteer.io/upload_gpx"
method="POST" enctype="multipart/form-data"
data-ng-controller="GpxFileUploadCtrl"
ng-submit="alert('gooo');">
<span class="btn btn-success fileinput-button" ng-class="{disabled: disabled}">
<i class="glyphicon glyphicon-plus"></i>
<span>Upload a GPX File</span>
<input type="file" name="gpx_file" ng-disabled="disabled">
{{ status }}
</span>
</form>
</div>
</div>模板在第一个包含之后停止。如果我移除第一个,它会在第二个之后停止。整个模板都包括在内,但在它之后不包含任何内容(在本例中,导航条是呈现的,但在它之后没有)。
没有抛出错误,模板都愉快地驻留在模板缓存中(正如它们出现的事实所证明的那样,它们只是停止行为)。
开发模式中的代码没有问题,我完全不知道如何进一步调试它。有什么方法可以打开详细的日志记录、调试等吗?我已经把代码缩小了,这样我就可以阅读一些东西了,但是没有任何错误被抛出,我不知道从哪里开始。
下面是我使用的所有依赖项的编辑版本:
"dependencies": {
"modernizr": "2.8.x",
"angular": "1.3.4",
"jquery" : "1.x.x",
"angular-animate" : "1.3.x",
"angular-cookies" : "1.3.x",
"angular-touch" : "1.3.x",
"angular-sanitize" : "1.3.x",
"angular-resource" : "1.3.x",
"angular-ui-router" : "0.2.x",
"angular-leaflet-directive" : "latest",
"lodash" : "latest",
"foundation" : "5.4.x",
"jquery-file-upload" : "latest"
},发布于 2014-11-26 23:02:40
我今天正在检查这个问题,我记得在W3Schools上使用了一个不同的符号。
他们使用:
<div ng-include="'myUsers_Form.htm'"></div>而不是:
<div ng-include="'myUsers_Form.htm'" />当我将第一个包含更改为您的风格时,我在该包含之后遇到了同样的问题,但是在W3Schools使用的表示法中,它可能包含多个文件。
发布于 2014-11-26 20:09:47
基于chat:切换到更完整的UI路由器实现可能解决与ng-include指令明显不兼容的问题。https://github.com/angular-ui/ui-router
https://stackoverflow.com/questions/27155589
复制相似问题