0.6.1 • Published 7 years ago

ng2-utils v0.6.1

Weekly downloads
644
License
MIT
Repository
github
Last release
7 years ago

ng2-utils

NG2-UI utility functions

Install

  1. install ng2-utils

    $ npm install ng2-utils --save

Use it in your code

App Component

    import { Ng2UtilsModule } from 'ng2-utils';

    import { AppComponent }   from './app.component';

    @NgModule({
      imports: [BrowserModule, Ng2UtilsModule],
      declarations: [AppComponent],
      bootstrap: [ AppComponent ]
    })
    export class AppModule { }

    platformBrowserDynamic().bootstrapModule(AppModule);

Javascript

    import { elementVisible, computedStyle, scrollTo, outerHeight, outerWidth } from 'ng2-utils';
    

HTML

    {{myHtml | htmlCode}}
    {{myHtml | htmlCode:'include'}}
    {{myHtml | htmlCode:'-include'}}
    {{ngOnInit | jsCode}}
    

DOM-related functions

  • computedStyle(element, styleName)
    • returns style value

  • elementVisible(innerElement, outerElement)
    • returns visiblility of top, bottom, left, and right

  • outerHeight(element)
    • return height in number

  • outerWidth(element)
    • return width in number

  • scrollTo(selector, parentCssSelector)

    • scrolls to a certain section in a second
    • returns void

pipes

  • string | htmlCode:'include,-exclude'

    • returns html string with tags included and excluded
  • string | jsCode

    • returns beautified Javascript code
0.6.1

7 years ago

0.6.0

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago

0.4.1

8 years ago

0.4.0

8 years ago

0.2.0

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.3.0

8 years ago