Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't bind to 'original' since it isn't a known native property #7103

Closed
wangzilong opened this issue Feb 16, 2016 · 3 comments
Closed

Can't bind to 'original' since it isn't a known native property #7103

wangzilong opened this issue Feb 16, 2016 · 3 comments

Comments

@wangzilong
Copy link

Hi everyone:
I want to add jquery_lazyload in my project

dependencies:
"angular2": "2.0.0-beta.3",
"jquery-lazyload": "1.9.7"

html code:

<div *ngFor="#page of pages">
   <img class="lazy" data-original="http://i-digi-sign.appspot.com{{page}}.jpg" width="595" height="842">
</div>

but it throw exception:

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@76: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

If I remove "{{page}}" from img.data-original, the code will work well.

How can I deal with it? please help me.

@todoubaba
Copy link
Contributor

<img [attr.data-original]="expr">

See: #4438

@wangzilong
Copy link
Author

Thanks, it works well.

<img class="lazy" attr.data-original="http://i-digi-sign.appspot.com{{page}}.jpg" width="595" height="842">
...

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants