Giter VIP home page Giter VIP logo

rectangly's Introduction

rectangly

Build Status npm node GitHub tag GitHub issues

A custom Angular 4+ renderer to use React for displaying the views. Ever wanted to use (most of) the React ecosystem in your Angular app? rectangly is here to help you out.

Hello World

Using rectangly is as simple as importing it via

npm i rectangly

and applying the following changes to your application root module.

import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { Rectangly } from 'rectangly';
import { MyPageComponent } from './mypage';

@NgModule({
  imports: [BrowserModule],
  providers: [Rectangly],
  schemas: [CUSTOM_ELEMENTS_SCHEMA],
  declarations: [MyPageComponent],
  bootstrap: [MyPageComponent],
})
export class PageModule {}

If you want to use some already created React components you should register them first:

import { registerComponents } from 'rectangly';
import { Button } from './mycomponents';

registerComponents('my', {
  Button,
});

Using the this custom element in Angular templates is as simple as writing

<my-Button [disabled]="true" (onClick)="toggleDisabled()">Toggle me</my-Button>

While standard attributes only supply strings to React, computed attributes (using the square brackets) will pass in the evaluated expression. Passing in functions should always be done via the listener attributes (using the round brackets).

Documentation

(tbd)

Development

Installation

For installing the following command is required:

npm install

This will resolve and install all (development) dependencies.

Tests

Running the tests is as simple as typing:

npm run test

This will also run the linter. The standalone unit tests are available via test:unit. Likewise, we can also easily report the code coverage:

npm run test:unit --coverage

Contributing

Contributions are welcome and happily reviewed / accepted via pull requests. For more details read CONTRIBUTING.md.

Changelog

This project adheres to semantic versioning.

A changelog exists, which should be rather complete from a high-level point of view. See CHANGELOG.md.

License

MIT © ZEISS Digital Innovation Partners see LICENSE.

rectangly's People

Contributors

boromo avatar florianrappl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  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.