NgComponent
A clean React-like abstraction for rendering non-Angular components within an Angular app.
Installation
npm install --save ngcomponent
Usage
Note: This example is in TypeScript, but it works just as well in vanilla JavaScript
Full Example
Lifecycle Hooks
NgComponent has a React-like component lifecycle API:
render()
(use this to react to changes tothis.props
)componentWillMount()
componentDidMount()
componentWillReceiveProps(props)
shouldComponentUpdate(props, state)
componentWillUpdate(props, state)
componentDidUpdate(props, state)
componentWillUnmount()
Running the Tests
npm test
Hacking On It
# Just watch TypeScript: npm run watch # Or, watch TypeScript and run tests on change: npm run tdd
License
Apache 2.0