{"id":18386990,"url":"https://github.com/f22hd/ng-lazy-img","last_synced_at":"2025-09-13T19:05:11.033Z","repository":{"id":35582550,"uuid":"187981681","full_name":"f22hd/ng-lazy-img","owner":"f22hd","description":"An angular directive that implementing lazy loading images.","archived":false,"fork":false,"pushed_at":"2023-01-07T05:41:56.000Z","size":2896,"stargazers_count":0,"open_issues_count":23,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T02:12:57.840Z","etag":null,"topics":["angular7","directive-angular"],"latest_commit_sha":null,"homepage":"https://ng-lazy-img.firebaseapp.com/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/f22hd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-22T07:01:42.000Z","updated_at":"2019-08-14T11:31:41.000Z","dependencies_parsed_at":"2022-09-17T05:10:33.968Z","dependency_job_id":null,"html_url":"https://github.com/f22hd/ng-lazy-img","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f22hd%2Fng-lazy-img","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f22hd%2Fng-lazy-img/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f22hd%2Fng-lazy-img/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/f22hd%2Fng-lazy-img/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/f22hd","download_url":"https://codeload.github.com/f22hd/ng-lazy-img/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248505925,"owners_count":21115354,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular7","directive-angular"],"created_at":"2024-11-06T01:24:13.469Z","updated_at":"2025-04-12T02:13:00.491Z","avatar_url":"https://github.com/f22hd.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[Demo](https://ng-lazy-img.firebaseapp.com/)\n\n## Getting Started\nAdd the directive to your app by run this command `npm i --save ng-lazy-img` in your terminal.\n\nThen import the directive into your module , such as app.module.ts\n```\n\nimport { NgLazyImgModule } from 'ng-lazy-img';\n\n@NgModule({\n  declarations: [\n    AppComponent\n  ],\n  imports: [ \n    ...\n    NgLazyImgModule.forRoot({\n      defaultImagePath:'/assets/default.png',\n      threshold: .4,\n      rootMargin:'0px'\n    })\n  ],\n  providers: [],\n  bootstrap: [AppComponent]\n})\nexport class AppModule { }\n\n```\n\n\nAdd the direcive in html image tag.\n\n``` \u003cimg NgLazyImg [src]=\"imgPath\"\u003e ```\n\n\nNow, should images loading lazily in browsing.\n\n\n##Notes:\nThe directive  will show default image until target image is loading.\n\nThis directive is using Intersection Observer API for implementing lazy loading. \n[Intersection_Observer_API](https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API)\nwe can see an explanation our parameters in doc.\n- threshold \n- rootMargin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff22hd%2Fng-lazy-img","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ff22hd%2Fng-lazy-img","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ff22hd%2Fng-lazy-img/lists"}