-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
React Integration for Itinerum #4
base: explore_react_integration
Are you sure you want to change the base?
Changes from 3 commits
2690c40
0ef36c1
1616bed
bd6340f
d48bba1
2d6351e
bf9c9f0
c6d3eed
8da04fb
68e27ce
1b51ff4
2a98a4f
0cdc1da
fda5412
15538f4
bda1af8
8768e1c
373450b
8383a86
0bd6f94
2a41b0f
1b83e41
a8ffdbc
2496d94
c96022d
19b3dc1
f4f8b1b
a49867a
16c1585
a80850f
42b0a83
5bdb2b5
097e6fc
7ef1a8a
0e853e3
1d4bde4
90ec37e
f332f04
e658d59
122066a
73c73a3
2327ade
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -23,6 +23,7 @@ angular.module('emission.intro', ['emission.splash.startprefs', | |||||
.controller('IntroCtrl', function($scope, $state, $window, $ionicSlideBoxDelegate, | ||||||
$ionicPopup, $ionicHistory, ionicToast, $timeout, CommHelper, StartPrefs, UpdateCheck, $translate, i18nUtils) { | ||||||
|
||||||
$scope.surveyState = { test: 'test', isValid: true, schema: {}, result: {} }; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$scope.platform = $window.device.platform; | ||||||
$scope.osver = $window.device.version.split(".")[0]; | ||||||
if($scope.platform.toLowerCase() == "android") { | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<ion-content class="has-footer"> | ||
<tutorial/> | ||
<tutorial test="surveyState.test" isValid="surveyState.isValid" schema="surveyState.schema" result="surveyState.result"/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not sure why you are passing the individual fields. can you just pass in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am attempting to pass the survey state via: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. https://stackoverflow.com/questions/49081549/passing-object-as-props-to-jsx Thought something like this would work.. alas I can't seem to get it right. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what do you mean by accessing variables within the $scope? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Within the .jsx file, we do the prop type checking. I believe one of the issues here is that we originally passed in the name, ie isValid="isValid". Now, we are only passing in the $scope variable surveyState. Code from .jsx:
My initial instinct was to attempt something like A few ways I've tried to pass in the surveyState: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. well, you would need to change the propTypes to accept a Also, check the spelling on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we changed the propTypes to accept a surveyState, would that be the only check?
I am not seeing how the propTypes would be changed to accept a surveyState object exactly. We would still want to do all the confirmation that isValid is a boolean etc. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah that would be the only check. Note that we already don't do any type checking within either the schema or the results, so we only lose type information for Let's first see if it works, and then we can make the design decision. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, here is a commit that does not quite work yet, but seems to be what we want. Still trying to figure out why this would not work. d48bba1 Question: Why do we need the Maybe they need to be key values pairs within the scope now? As in |
||
</ion-content> | ||
<ion-footer-bar class="no-bgColor" id="intro-footer"> | ||
<button class="button button-block button-outline button-positive" ng-click="next()"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully something like this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! This works perfectly. (Surprised it is so simple.)