Comments (3)
When I pass the callback with &
, the communication from child to parent is broken. However when I pass it with <
or =
, it works: the callback provided in react props is being called. The question is how robust this approach is. What do you say?
I am not too familiar with angular internals, so I would like to hear an opinion from someone more experienced.
from angular2react.
Hi @korya. Unfortunately, React only supports 1-way bindings (<
). The idea is to simplify the way data flows by eliminating 2-way bindings (=
) and expression bindings (&
).
Expression bindings are really a type of 1-way binding. You can update your code to use <
bindings instead. For example:
// before
<component onClick="onClick(value)"></component>
// after
<component onClick="onClick"></component>
I hope that helps!
from angular2react.
OK. Thanks.
from angular2react.
Related Issues (19)
- Getting a reference to $injector HOT 9
- dependency issues HOT 4
- Seeing `[email protected] requires a peer of react@^>=15.0.0 but none is installed` warning HOT 1
- npm test fails on Windows HOT 2
- Disable Greenkeeper HOT 1
- angular2react method can be simplified HOT 3
- Minimum version AngularJS version HOT 1
- Context Api doesn't work HOT 2
- React 17 deprecated methods HOT 2
- How does it apply to complex applications
- Trigger $destroy on jqLite elements
- way to work in angular 1.4
- onClick not triggered on angular2react element HOT 2
- Will it be possible to use the Hooks and React 17?
- Does this library have to load Angular?
- Page refreshes when routing to an AngularJS component HOT 1
- Angular 1.6 requirement? HOT 2
- Does it work with Angular 1.6 Directives as well? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular2react.