🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

angular-vdom

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-vdom

Use virtual-dom components in an angular application by taking advantage of angulars new [component lifecycle hooks](https://docs.angularjs.org/guide/component).

npmnpm
Version
0.3.1
Version published
Weekly downloads
2
100%
Maintainers
1
Weekly downloads
 
Created
Source

angular-vdom

Use virtual-dom components in an angular application by taking advantage of angulars new component lifecycle hooks.

Usage

// app.js
var h = require('virtual-dom/h')
var ngVirtualComponent = require('angular-vdom')
var virtualComponent = ngVirtualComponent(render, {bindings: {message: '<'}})

module.exports = require('angular')
  .module('app', [])
  .component('virtualComponent', virtualComponent)
  .name

function render (message) {
  return h('div', message)
}

// index.html

<div ng-app="app">
  <virtual-component message="Hello World!"></virtual-component>
</div>

API

angular-vdom exports a function that takes in few params:
ngVirtualComponent(render, options)

Render function
required: true
function that returns virtual nodes

Options
required: true
type: object
Default values for configuring the angular component. Binded value changes will trigger an .$onChange(), which will then rAF and render

Building

npm i && npm run build
cd example/
open index.html

FAQs

Package last updated on 16 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts