Skip to content

Commit

Permalink
Attempt for the react->angular process. Would like to get Kyle's feed…
Browse files Browse the repository at this point in the history
…back on this and what improvements are needed.

Working on understanding the prop vs state differences.
  • Loading branch information
jruzekowicz committed Jul 20, 2021
1 parent 2d6351e commit bf9c9f0
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions www/components/itinerum_tutorial/Tutorial.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,34 @@ class TutorialComponent extends React.Component {
result: React.PropTypes.object,
schema: React.PropTypes.object
}
constructor(props) {
super(props);
this.state = {
schema: {
fname: this.props.fname,
lname: this.props.lname
}
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
this.setState({
schema: {
fname: event.target.value,
lname: 'Ruzekowicz'
}
});
}
render() {
return(
<div className="content-wrapper">
<div>
First Name -> {this.props.schema.fname}
Last Name -> {this.props.schema.lname}
</div>
<div>
<input type="text" value={this.state.schema.fname} onChange={this.handleChange} />
</div>
<div className="row">
{/* bootstrap grid as margin */}
<div className="col-xs-2" />
Expand Down

0 comments on commit bf9c9f0

Please sign in to comment.