
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
angular2react
Advanced tools
One line of code to turn any Angular 1 Component into a React Component (opposite of react2angular)
# Using Yarn:
yarn add angular2react angular angular-resource react react-dom
# Or, using NPM:
npm install angular2react angular angular-resource react react-dom --save
$injector
let $injector
angular
.module('myModule')
.run(['$injector', function(_$injector) { $injector = _$injector }])
const MyComponent = {
bindings: {
fooBar: '<',
baz: '<'
},
template: `
<p>FooBar: {this.$ctrl.fooBar}</p>
<p>Baz: {this.$ctrl.baz}</p>
`
}
angular
.module('myModule', [])
.component('myComponent', MyComponent)
import { angular2react } from 'angular2react'
const MyComponent = angular2react('myComponent', MyComponent, $injector)
<MyComponent fooBar={3} baz='baz' />
We need a reference to the $injector
created by the Angular module that registered the Angular component you're exposing. That way we can manually compile your component.
If you use ngimport, you can skip step 1 and omit the last argument in step 4:
import { angular2react } from 'angular2react'
const MyComponent = angular2react('myComponent', MyComponent)
https://github.com/bcherny/angular2react-demos
<
) are supported, because this is the only type of binding that React supportsnpm test
Apache-2.0
FAQs
One line of code to turn any Angular 1 Component into a React Component
The npm package angular2react receives a total of 4,645 weekly downloads. As such, angular2react popularity was classified as popular.
We found that angular2react demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.