npm

Need private packages and team management tools?Check out npm Orgs. »

react-directives

0.1.0 • Public • Published

react-directives

Seamless bridge between React and Angular.

Installation

  • npm install react-directives --save

Usage

import React, { PropTypes } from 'react';
import reactDirectives from 'react-directives';
import angular from 'angular';
 
function ButtonComponent ({ onClick, text }) {
  return (
    <button type="button" onClick={() => onClick()}>
      {text}
    </button>
  );
}
 
ButtonComponent.propTypes = {
  onClick: PropTypes.func.isRequired,
  text: PropTypes.string.isRequired
};
 
angular
  .module('react-app', [])
  .directive(reactDirectives({ ButtonComponent }));
<div ng-controller="DemoController as demo">
  <button-component on-click="demo.doSomething"
                    text="demo.text"></button-component>
</div>

install

npm i react-directives

Downloadsweekly downloads

4

version

0.1.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability