Skip to content

wizbii/react-directives

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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>

About

Seamless bridge between React and Angular.

Resources

License

Stars

Watchers

Forks

Packages

No packages published