{"id":15910511,"url":"https://github.com/robert197/angular2-set-class-in-view","last_synced_at":"2025-04-03T01:22:33.858Z","repository":{"id":57179720,"uuid":"68947725","full_name":"robert197/angular2-set-class-in-view","owner":"robert197","description":"angular2 directive which sets a given class to element where attribute [setClassInView]=\"'className'\" is placed.","archived":false,"fork":false,"pushed_at":"2016-10-23T13:23:36.000Z","size":7327,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T01:04:56.514Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/robert197.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":"2016-09-22T17:58:54.000Z","updated_at":"2016-10-23T13:23:37.000Z","dependencies_parsed_at":"2022-09-26T16:51:03.770Z","dependency_job_id":null,"html_url":"https://github.com/robert197/angular2-set-class-in-view","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/robert197%2Fangular2-set-class-in-view","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert197%2Fangular2-set-class-in-view/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert197%2Fangular2-set-class-in-view/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/robert197%2Fangular2-set-class-in-view/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/robert197","download_url":"https://codeload.github.com/robert197/angular2-set-class-in-view/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246917821,"owners_count":20854710,"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":[],"created_at":"2024-10-06T15:07:30.332Z","updated_at":"2025-04-03T01:22:33.813Z","avatar_url":"https://github.com/robert197.png","language":"TypeScript","readme":"# angular2-set-class-in-view\nangular2-set-class-in-view is a plugin directive for [Angular 2](http://angular.io).\n\n#### Setup\n----------\n\nTo use the Angular set class in view, simply run `npm install angular2-set-class-in-view` and then include SetClassInView in your project (see Example for more details).\n\n#### Config / Example\n-----------\n\nAngular2 set class in view sets is able to set class on every element which appears in viewport of mobile or desktop browser. \n\n```javascript\nimport { NgModule }      from '@angular/core';\nimport { BrowserModule } from '@angular/platform-browser';\n\nimport { AppComponent }   from './app.component';\nimport { SetClassInView } from 'angular2-set-class-in-view/main';\n\n@NgModule({\n  imports: [ BrowserModule ],\n  declarations: [\n      AppComponent,\n      SetClassInView\n  ],\n  bootstrap:    [ AppComponent ]\n})\nexport class AppModule { }\n\n```\n\n```html\n\u003cdiv [setClassInView]=\"'show'\"\u003e\n    \u003ch3\u003eThis element is in view\u003c/h3\u003e\n    \u003cimg src=\"images/image.jpg\" alt=\"image\"\u003e\n\u003c/div\u003e\n```\n\n#### Config / Example\n-----------\n\nWhen you are using SystemJs you need to load angular2-set-class-in-view dependency\n\n```javascript\n'angular2-set-class-in-view': {\n        main: './main.js',\n        defaultExtension: 'js'\n      }\n```\nand map 'angular2-set-class-in-view to 'node_modules/angular2-set-class-in-view'.\n\nYour systemjs.config.js could look like: \n\n```javascript\n(function (global) {\n  System.config({\n    paths: {\n      // paths serve as alias\n      'npm:': 'node_modules/'\n    },\n    // map tells the System loader where to look for things\n    map: {\n      // our app is within the app folder\n      app: 'app',\n      '@angular/core': 'npm:@angular/core/bundles/core.umd.js',\n      'rxjs':                       'npm:rxjs',\n      'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',\n      'angular2-set-class-in-view': 'npm:angular2-set-class-in-view'\n    },\n    // packages tells the System loader how to load when no filename and/or no extension\n    packages: {\n      app: {\n        main: './main.js',\n        defaultExtension: 'js'\n      },\n      rxjs: {\n        defaultExtension: 'js'\n      },\n      'angular2-in-memory-web-api': {\n        main: './index.js',\n        defaultExtension: 'js'\n      },\n      'angular2-set-class-in-view': {\n        main: './main.js',\n        defaultExtension: 'js'\n      }\n    }\n  });\n})(this);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert197%2Fangular2-set-class-in-view","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frobert197%2Fangular2-set-class-in-view","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frobert197%2Fangular2-set-class-in-view/lists"}