皆さんこんにちは:
プロジェクトにjquery_lazyloadを追加したい
依存関係:
"angular2": "2.0.0-beta.3"、
"jquery-lazyload": "1.9.7"
htmlコード:
<div *ngFor="#page of pages">
<img class="lazy" data-original="http://i-digi-sign.appspot.com{{page}}.jpg" width="595" height="842">
</div>
しかし、それは例外をスローします:
Error: Template parse errors:
Can't bind to 'original' since it isn't a known native property (""595" height="842" style="margin-top: 10px;">-->
<img class="lazy" [ERROR ->]data-original="http://i-digi-sign.appspot.com{{page}}.jpg" width="595" height="842" style="margin-top"): TemplateEditComponent<strong i="15">@76</strong>:50
at new BaseException (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2.dev.js:7325:21)
at TemplateParser.parse (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2.dev.js:23440:15)
at http://127.0.0.1:8888/node_modules/angular2/bundles/angular2.dev.js:24136:54
at Zone.run (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2-polyfills.js:1243:24)
at Zone.run (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2.dev.js:13408:32)
at zoneBoundFn (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2-polyfills.js:1220:26)
at lib$es6$promise$$internal$$tryCatch (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2-polyfills.js:468:17)
at lib$es6$promise$$internal$$invokeCallback (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2-polyfills.js:480:18)
at lib$es6$promise$$internal$$publish (http://127.0.0.1:8888/node_modules/angular2/bundles/angular2-polyfills.js:451:12)
at http://127.0.0.1:8888/node_modules/angular2/bundles/angular2-polyfills.js:123:10
img.data-originalから "{{page}}"を削除すると、コードは正常に機能します。
どうすれば対処できますか? 私を助けてください。
<img [attr.data-original]="expr">
参照: https ://github.com/angular/angular/issues/4438
おかげで、それはうまくいきます。
<img class="lazy" attr.data-original="http://i-digi-sign.appspot.com{{page}}.jpg" width="595" height="842">
...
この問題は、非アクティブのために自動的にロックされています。
同様の問題または関連する問題が発生した場合は、新しい問題を提出してください。
自動会話ロックポリシーの詳細をご覧ください。
_このアクションはボットによって自動的に実行されました。_
最も参考になるコメント
参照: https ://github.com/angular/angular/issues/4438