Comments (5)
Hi @frankandrobot! Unfortunately from your description it's not clear to me what's causing this. If you could post a self contained repro case in something like StackBlitz that would be really helpful.
from react2angular.
Sorry I'm using an old Angular 1.5.8... just took a look at stackblitz and it comes preconfigured with the latest Angular. And I don't believe you have a version of react2angular that can be loaded in a script tag (so no to js fiddle).
The example is very easy to repo.
- Initialize the redux state
- Create an AJAX request in the component $onInit that updates the redux state
- Use the redux state to control the value of
ng-disabled
.
from react2angular.
@frankandrobot I want to help get to the root of this issue, and I need a full repro case to get there. If Stackblitz doesn't work for you, could you attach a minimal repro case in a zip file?
from react2angular.
OMG, what the fuck? It looks like this is some wierd Angular issue (why am I not surprised). Here is the minimal HTML template. Notice how I have two inputs behind an ng-if
. If I change ng-if
to ng-show
, all sorts of wierdness happens:
- The form never validates (and as a result, the submit never is never enabled)
- The email thinks it's invalid on start (which is what started this issue in the first place).
Gonna test now with both inputs showing (which is actually hard to do in my code base---because getting the database in that state is tricky). And see if everything is well.
<form role="form" name="$ctrl.angularState.form" ng-submit="$ctrl.update()">
<div ng-if="$ctrl.missing.username"
class="form-group textInputContainer"
ng-class="{ 'hasError' : $ctrl.angularState.form.username.$invalid && !$ctrl.angularState.form.username.$pristine }"
>
<label for="username">Username</label>
<input type="text"
class="form-control"
name="username"
ng-model="$ctrl.user.username"
valid-username
not-blank='{"disabled": {{!!$ctrl.readonly.username}}}'
ng-disabled="!!$ctrl.readonly.username"
autofocus
/>
</div>
<div ng-if="$ctrl.missing.email"
class="form-group textInputContainer"
ng-class="{ 'hasError' : $ctrl.angularState.form.email.$invalid && !$ctrl.angularState.form.email.$pristine }"
>
<label for="email">Email</label>
<input type="text"
class="form-control"
name="email"
ng-model="$ctrl.user.email"
valid-email='{"disabled": {{!!$ctrl.readonly.email}}}'
not-blank='{"disabled": {{!!$ctrl.readonly.email}}}'
ng-disabled='!!$ctrl.readonly.email'
/>
<input type="submit"
class="btn"
ng-class="{disabled: $ctrl.saving || !$ctrl.angularState.form.$valid, 'btn-primary': !$ctrl.saving && $ctrl.angularState.form.$valid}"
ng-disabled="$ctrl.saving || !$ctrl.angularState.form.$valid"
value="Save"
/>
</form>
from react2angular.
Update this works just fine now. Gonna write this off as another one of those "angular quirks"
from react2angular.
Related Issues (20)
- Is it possible to pass function with params from angular parent component to react child component with react2angular library? HOT 1
- Collision of React Props and Angular Component Class Members HOT 1
- Doesnt work correct in table HOT 1
- No documentation on function binding incompatibility HOT 1
- React hooks HOT 5
- How to share React Context with Angular HOT 3
- Memory leak HOT 4
- How to provide redux store store? HOT 2
- Uncaught SyntaxError: Cannot use import statement outside a module
- Is it works with TypeScript? HOT 2
- Angular 10 support?
- Does this support React.lazy component HOT 1
- How can I render children inside the react component? HOT 2
- Issue when bundling
- Critical Vulnerability in react2angular > ngcomponent > lodash path
- Webpack Module Federation Support
- angularApp.component is not a function HOT 1
- React 18 upgrade HOT 4
- React 18 Support HOT 3
- Are React functional components supported? HOT 1
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 react2angular.