添加时刻选择器时出现ng-include [parse:syntax]错误

时间:2017-07-27 16:20:54

标签: javascript angularjs datepicker momentjs datetimepicker

我在实现angular-moment-picker lib for datetimes

时遇到问题

原始工作模板“step1.html”:

<input type="datetime" class="form-control" ng-model="theDate" name="theDate" view="date" auto-close="true" min-view="date" format="{{$root.getLocalDateFormat()}}" ng-disabled="editPage" required >
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>

添加时刻选择器时不再工作:

<input type="datetime" class="form-control" moment-picker="jobRecurrence.startDate" ng-model="theDate" name="theDate" view="date" auto-close="true" min-view="date" format="{{$root.getLocalDateFormat()}}" ng-disabled="editPage" required >
    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>

我得到了chrome的控制台错误:

Error: [$parse:syntax] http://errors.angularjs.org/1.4.8/$parse/syntax?p0=%7B&p1=invalid%20key&p2=…s%20%3D%3D%3D%20'endDate'%20%3F%20jobRecurrence.endDate%20%3A%20null%7D%7D
    at http://localhost:8089/lib/angular/angular.min.js:6:416
    at s.throwError (http://localhost:8089/lib/angular/angular.min.js:210:32)
    at s.object (http://localhost:8089/lib/angular/angular.min.js:209:327)
    at s.primary (http://localhost:8089/lib/angular/angular.min.js:206:335)
    at s.unary (http://localhost:8089/lib/angular/angular.min.js:206:174)
    at s.multiplicative (http://localhost:8089/lib/angular/angular.min.js:205:434)
    at s.additive (http://localhost:8089/lib/angular/angular.min.js:205:261)
    at s.relational (http://localhost:8089/lib/angular/angular.min.js:205:96)
    at s.equality (http://localhost:8089/lib/angular/angular.min.js:204:425)
    at s.logicalAND (http://localhost:8089/lib/angular/angular.min.js:204:278) <div ng-include="'html/jobRecurrence/wizard/step1.html'" class="ng-scope" data-ng-animate="1">
(anonymous) @ angular.min.js:107

Moment-picker适用于应用程序上的其他任何位置。只有这个模板会产生问题。

0 个答案:

没有答案