GithubHelp home page GithubHelp logo

isabella232 / angular-include-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from medallia/angular-include-react

0.0 0.0 0.0 541 KB

Include React container components into a AngularJS+Redux SPA

License: MIT License

JavaScript 100.00%

angular-include-react's Introduction

Angular Include React

=============

React Include allows you to embed React container components inside an AngularJS application, synchronizing them through a Redux store. You can think of it as a lightweight alternative to ng-react, that avoids all the integration quirks by connecting the components through redux (that's framework agnostic), instead of transforming AngularJS bindings to React props.

It is built on top of the most widely adopted redux-frameworks for both libraries, ng-redux and react-redux, and follows the best practices that are also widely adopted in the javascript community regarding Redux integration with each framework.

Installation

Install via yarn:

yarn add @m/angular-include-react

or via npm:

npm i --save @m/angular-include-react

Usage

Add angularIncludeReact as a dependency to your angular application

import angular from 'angular';
import angularIncludeReact from '@m/angular-include-react';

const ngModule = angular.module('app', [
	// Add angular include react angular module as a dependency
	angularIncludeReact
]);

Register some react container components via the includeReact angular service, with an arbitrary name

import { connect } from 'react-redux';

const ReactContainerComponent = connect(/* ... */);

ngModule.run(function(includeReact) {
	includeReact.registerComponent('my-react-component', ReactContainerComponent);
});

And finally, include the components into your angular template with the include-react directive

<include-react component="my-react-component"></include-react>

Developing

To start the development server, just run:

npm install
npm start

Build Library

npm run build

Build Demo

npm run build:demo

Start development server

npm run serve

Tests

npm test

Lint

npm run lint

or

npm run lint:fix

License & Copyright

This software is copyrighted 2017 by Medallia, Inc. and released under the MIT License.

angular-include-react's People

Contributors

dagimene avatar surbinamed avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.