New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

react2angularjs

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react2angularjs

A fully functional way to integrate React components in Angular 1 apps!

latest
Source
npmnpm
Version
1.0.2
Version published
Maintainers
1
Created
Source

Use React in Angular along with Transclusion/Children

Installation

npm install --save react2angularjs

How to use

import react2angularjs from 'react2angularjs';

angular.module('app', [])
  .directive('ReactComponent1', react2angularjs(ReactComponent, ['prop1', 'prop2']))
  .directive('ReactInput', react2angularjs(ReactInput, ['value', 'onChange']))

Using in Angularjs Template

<react-input default-value="'123'" value="$ctrl.value" on-change="$ctrl.onChange" >
  ...
</react-input>

Transclusion

import react2angularjs from 'react2angularjs';
import Tooltip from 'rc-tooltip';

angular.module('app', [])
  .directive('reactTooltip', react2angularjs(Tooltip, ['placement', 'overlay']))

Using in Angular template

<react-tooltip placement="'right'" overlay="'tooltip message'">
  <button ng-click="$ctrl.onSignInClicked()">Sign in</button>
</react-tooltip>

Event callback

<react-tooltip placement="'right'" overlay="'tooltip message'" on-close="$ctrl.onClose">
  <button ng-click="$ctrl.onSignInClicked()">Sign in</button>
</react-tooltip>

Live Demo

CodeSandbox - https://codesandbox.io/s/react-2-angularjs-uttki

Keywords

react2angular

FAQs

Package last updated on 09 Jun 2022

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