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 'lazyload' since it isn't a known native property #37
Comments
Hi, I can't reproduce the problem. What version of ng2-lazyload-image are you using? Is your project open source so I can take a look at it? Steps I took:
Updated the code:`app/pages/home/home.html: <ion-header>
<ion-navbar>
<ion-title>Home</ion-title>
</ion-navbar>
</ion-header>
<ion-content padding class="home" #container>
<h2>Welcome to Ionic!</h2>
<p>
This starter project comes with simple tabs-based layout for apps
that are going to primarily use a Tabbed UI.
</p>
<p style="height: 1000px;">
Take a look at the <code>app/</code> directory to add or change tabs,
update any existing page or create new pages.
</p>
<img
style="height: 1099px;"
[src]="defaultImage"
[lazyLoad]="image"
[offset]="offset"
[scrollTarget]="container._scroll._el">
</ion-content> `app/pages/home/home.ts: import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import { LazyLoadImageDirective } from 'ng2-lazyload-image';
@Component({
templateUrl: 'build/pages/home/home.html',
directives: [ LazyLoadImageDirective ]
})
export class HomePage {
defaultImage = 'https://www.placecage.com/1000/1000';
image = 'https://hd.unsplash.com/photo-1441765425173-8fd330fb4a02';
offset = 100;
constructor(private navCtrl: NavController) {
}
} And it works fine :) HOWEVER, since ionic is using tabs (per default) and adding One solution is however to check if the image is hidden (eg: <img
*ngIf="container._scroll._el.offsetParent !== null"
style="height: 1099px;"
[src]="defaultImage"
[lazyLoad]="image"
[offset]="offset"
[scrollTarget]="container._scroll._el"> But that doesn't look any good :/ So.. you might or might not be able to use |
You made a typo. Cheers :) |
That sounds embarrassingly simple. On Mon, Oct 17, 2016 at 1:37 PM, Stan Faas notifications@github.com wrote:
|
@StanFaas, nice catch! |
I'm running an existing Ionic 2 project (2.0.0-beta.11, using Angular 2.0.0-rc.4). Installed and setup, but keep getting the following error (The error occurs on runtime. No issue when compiling)
Steps I took:
Ran Npm:
$ npm install ng2-lazyload-image --save
Imported into my component:
import { LazyLoadImageDirective } from 'ng2-lazyload-image';
Set Directives:
directives: [ LazyLoadImageDirective ]
Set variables and defaults:
In my template:
<img [src]="defaultImage" [lazyload]="feedImage" [offset]="offset" class="feed-image">
Maybe there's something I'm overlooking, but I can't seem to see what it is.
The text was updated successfully, but these errors were encountered: