Showing posts with label ng2-ui-parallax-scroll. Show all posts
Showing posts with label ng2-ui-parallax-scroll. Show all posts
ng2-ui-parallax-scroll

ng2-ui-parallax-scroll

October 10, 2017
Angular2 parallax background scroll directive

Demo

Note:

After 0.5.0 or higher, ng2-parallax-scroll has been changed to @ngui/parallax-scroll. Here are the changes;
  • Module ng2-parallax-scroll is changed to @ngui/parallax-scroll.
  • Direvtive ng2-parallax-scroll is changed to ngui-parallax-scroll.
  • Class name Ng2ParallaxScrollModule is changed to NguiParallaxScrollModule

Install

  1. install @ngui/parallax-scroll
     $ npm install @ngui/parallax-scroll --save  
    
  2. add map and packages to your systemjs.config.js
      map['@ngui/parallax-scroll'] = '@ngui/parallax-scroll/dist/parallax-scroll.umd.js';  
    
  3. import NguiParallaxScrollModule to your AppModule import { NgModule } from '@angular/core'; import { FormsModule } from "@angular/forms"; import { BrowserModule } from '@angular/platform-browser'; import { AppComponent } from './app.component'; import { NguiParallaxScrollModule } from '@ngui/parallax-scroll'
  4.  @NgModule({  
       imports: [BrowserModule, FormsModule, NguiParallaxScroll],  
       declarations: [AppComponent],  
       bootstrap: [ AppComponent ]  
      })  
      export class AppModule { }  
    
For full example, please check out test directory to see the example of
  • systemjs.config.js
  • app.module.ts
  • and app.component.ts

Use it in your code

 <div ngui-parallax style="height: 300px">  
   <img src="http://materializecss.com/images/parallax1.jpg" />  
  </div>  


Note: Special thanks to ng2-ui

Contact: allenhwkim@gmail.com

Disclaimer: The blog is created to share angular directives information to geek, curious Angular Developers.