ng-包括找不到ng-template

时间:2016-05-30 01:08:38

标签: angularjs angularjs-ng-include ng-template

大家好我是棱角分明的。我的帖子与Inline `ng-template` not found by `ng-include`相同。

我有一个ng-include,它找不到我的ng-template,继续得到404:无法加载资源:服务器响应状态为404(Not Found)http://localhost/display

当我将模板放在一个单独的html文件中时,它工作正常,但显然这并不理想。

非常感谢任何想法。

我的观点:

cv::Mat1i image = ...; // suppose this is your input (CV_32S == Mat_<int>)
cv::Mat1f output = ...; // suppose this is your output (CV_32F == Mat_<float>)

image.convertTo(image, CV_32F); // add this line right before the call
call_to_filter(image, output, ...); // your function (or filter) call
// e.g.: cv::Sobel(image, output, ...) will throw this error without convertion

我的index.html

<div class="panel panel-primary"
 ng-controller="TimesheetListCtrl as vm">
<div class="panel-heading"
     style="font-size:large">
    Timesheet for week ending 
</div>
<div class="panel-body">
    <table class="table">
        <thead>
            <tr>
                <td>Program</td>
                <td>Category</td>
                <td>Activity</td>
                <td>Reference</td>
                <td>Monday</td>
                <td>Tuesday</td>
                <td>Wednesday</td>
                <td>Thursday</td>
                <td>Friday</td>
                <td>Saturday</td>
                <td>Sunday</td>
                <td>Total</td>
                <td></td>
            </tr>
        </thead>
        <tbody>
        <tr ng-repeat="timesheet in vm.timesheets" ng-include="'display'"><!--ng-include="vm.getTemplate(timesheet)"-->
            <script type="text/ng-template" id="display">
                <td>{{ timesheet.program }}</td>
                <td>{{ timesheet.category }}</td>
                <td>{{ timesheet.activity }}</td>
                <td>{{ timesheet.reference }}</td>
                <td>{{ timesheet.hrsWrkMonday }}</td>
                <td>{{ timesheet.hrsWrkTuesday }}</td>
                <td>{{ timesheet.hrsWrkWednesday }}</td>
                <td>{{ timesheet.hrsWrkThursday }}</td>
                <td>{{ timesheet.hrsWrkFriday }}</td>
                <td>{{ timesheet.hrsWrkSaturday }}</td>
                <td>{{ timesheet.hrsWrkSunday }}</td>
                <td><b>{{ timesheet.hrsWrkMonday + timesheet.hrsWrkTuesday + timesheet.hrsWrkWednesday + timesheet.hrsWrkThursday + timesheet.hrsWrkFriday + timesheet.hrsWrkSaturday + timesheet.hrsWrkSunday }}</b></td>
                <td><a class="btn btn-primary">Edit</a>
                    <a class="btn btn-primary">Delete</a></td>                
            </script>
            <script type="text/ng-template" id="edit">
                <td>Program EDIT</td>
                <td>Category EDIT</td>
                <td>Activity EDIT</td>
                <td>Reference EDIT</td>
                <td>Monday EDIT</td>
                <td>Tuesday EDIT</td>
                <td>Wednesday EDIT</td>
                <td>Thursday EDIT</td>
                <td>Friday EDIT</td>
                <td>Saturday EDIT</td>
                <td>Sunday EDIT</td>
                <td>Total EDIT</td>
                <td><a class="btn btn-primary">Save</a>
                    <a class="btn btn-primary">Cancel</a>
                </td>                
            </script>
        </tr>
        </tbody>
    </table>
</div>

0 个答案:

没有答案