Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
¿Cómo agregar componentes de reacción al proyecto angular?

Tengo que agregar algunos componentes angulares al proyecto angular y encontré este paquete. Hice los siguientes pasos:

  1. npm install react2angular react react-dom prop-types --save en el proyecto angular

  2. Agrega un directorio (en el proyecto raíz) llamado src y dentro de él un index.js con el siguiente código:

     import { react2angular } from "react2angular"; import React from "react"; function Example() { return <button type="button">Click me</button>; } angular .module("myModule") .component("example", react2angular(Example, ["apiUrl", "token"]));
  3. después de esto, moví el código angular y agregué

     <example api-url="123" token="456"/>

No pasa nada. No aparece ningún botón.

Esto parece estar hecho en base a la documentación oficial. ¿Hice algo mal? Tenga en cuenta que no tengo experiencia con angular, por eso quiero trabajar con reaccionar.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

1. Create a React component import React from 'react'; const ReactComponent = ({ fooBar, baz}) => ( <div> <span>value: {fooBar} </span> <button onClick={baz}> Add one </button> </div> ); export default ReactComponent; 2. Expose it to Angular import { react2angular } from 'react2angular' angular .module('myModule', []) .component('myComponent', react2angular(ReactComponent, ['fooBar', 'baz'])) 3. Use it in your Angular 1 code <my-component foo-bar="3" baz="'baz'" ></my-component>

https://stackblitz.com/edit/react2angular-multiple-modules-cg9zaw?file=angular-component.js

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!