Share
Embed
Transcript
30 slides
-
ࣗݾհ ɾ٢ຊ߂ ɾגࣜձࣾϏζϦʔνॴଐ ɾαʔόʔαΠυΤϯδχΞ ɾࣄͰ͍ͬͯΔٕज़ ɹɹJavaɺJavaScript(jQuery)ɺHTMLɺCSS ɹɹMySQLɺAWSɺLinux ɹɹiOSΞϓϦ(Objective-C,Swift)ɺAndroidΞϓϦ(Java) ɹɹzuknow –
༑ୡͱΫΠζͰڝ͑ΔֶशΞϓϦ ɹɹɹhttps://www.zuknow.net/ ɹɹΩϟϦΞτϨοΫ–Ϩίϝϯυܕస৬αΠτ ɹɹɹhttps://www.careertrek.com/ -
Onsen UIͱAngularJS1ܥ [Onsen UI] ɹɾAngularJSΛϕʔεʹϞόΠϧΞϓϦ࡞ʹ ɹɹඞཁͳUIΛఏڙ ɹɾଟ࠼ͳUIίϯϙʔωϯτ ɹɾHTMLΛ֦ு͠ɺλάܗࣜͰఏڙ [Angular JS]
ɹɾGoogleʹΑͬͯ։ൃ͞ΕͨJavaScriptͷ ɹɹMVCϑϨʔϜϫʔΫ ɹɾෳࡶԽ͢ΔWebΞϓϦͷϑϩϯτ෦Λޮతʹ ɹɹ͢Δػೳ͕ॆ࣮ -
Onsen UIͷߏ <ons-page ng-controller="AppController as app"> <ons-tabbar> <ons-tab page=“search.html"></ons-tab> <ons-tab
page=“like.html”></ons-tab> </ons-tabbar> </ons-page> <ons-template id=“search.html"> ɾɾɾ </ons-template> <ons-template id=“like.html”> ɾɾɾ </ons-template> <ons-template id=“result.html”> ɾɾɾ </ons-template> JSͰΓସ͑ -
Onsen UIʢ̍ʣ ɾons-template ɹɹhtmlͷςϯϓϨʔτΛఆٛ͢Δ ɹɹݺͼग़͢ͱ͖ʹɺςϯϓϨʔτͷIDΛࢦఆɹɹ <ons-template id="foobar.html"> ... </ons-template> ɾons-tabbar
ɹɹࢠཁૉons-tabͷpageଐੑʹ ɹɹλϒͰදࣔ͢ΔϖʔδΛࢦఆ͢Δɹɹ <ons-tabbar> <ons-tab page=”tab1.html" active="true”></ons-tab> <ons-tab page=”tab2.html" active="true”></ons-tab> </ons-tab> -
Onsen UIʢ̎ʣ ɾons-listɺons-list-item ɹɹϦετΛදݱ͢ΔͨΊͷίϯϙʔωϯτ <ons-list> <ons-list-header>Header Text</ons-list-header> <ons-list-item>Item1</ons-list-item> <ons-list-item>Item2</ons-list-item> </ons-list>
ৄ͘͠ɺ ɹɾʮOnsen UI 1.xΨΠυʯ(ຊޠ)ɹ(https://ja.onsen.io/v1/guide.html) ɹɾʮOnsen UI 2 Docsʯʢӳޠʣɹ(https://onsen.io/v2/docs/js.html) -
AngularJSͷߏ ons.bootstrap().controller('AppController', function($scope, $http) { ɹɹɹɾɾɾ } AppControllerΛఆٛ͢Δ index.html $scope.searchShops
=[shop1, shop2, ɾɾɾ]; $scope.likeShops =[shop1, shop2, ɾɾɾ]; Shop{ name,image_url,isLiked } ΦϒδΣΫτͷߏ -
AngularJSͷαʔϏε ແ໊ؔͷҾʹࢦఆͨ͠ม໊Λݩʹɺ ඞཁͳαʔϏεΛมʹ͢ɻ ্هͷ߹ɺ$scopeαʔϏεͱ$httpαʔϏεɻ module.controller('AppController', function($scope, $http) { ɹ$scope.search =
function() { ɾɾɾ ɹ}; }; αʔϏεͱ ɾWebΞϓϦέʔγϣϯڞ௨ͷಛఆͷλεΫΛ࣮ߦ͢Δؔ܈ ɾγϯάϧτϯΦϒδΣΫτ ɾΈࠐΈαʔϏεʮ$ʯ͔Β࢝·Δ ɾಠࣗͷΧελϜαʔϏεΛ࡞Δ͜ͱͰ͖Δ -
σʔλ(js) σʔλόΠϯσΟϯάʢ̎ʣʢAngularJSʣ ը໘(html) <ons-list-item ng-repeat="shop in searchShops”> ɹɹ{{ shop.name }}
ɹɹ{{ shop.address }} </ons-list-item> <ons-list-item ng-repeat="shop in likeShops”> ɹɹ{{ shop.name }} ɹɹ{{ shop.address }} </ons-list-item> $scopeͷσʔλΛมߋ͢Δͱɺ ද͕ࣔมߋ͞ΕΔ $scope. searchShops $scope. likeShops -
σΟϨΫςΟϒʢ̍ʣ ɾng-repeat ɹɹྻʹ܁Γฦ͠ॲཧΛ࣮ࢪ͠ɺ ɹɹల։ͨ͠σʔλΛදࣔ͢Δ <ons-list> <ons-list-item ng-repeat=“data in dataList”> {{
data }} </ons-list-item> </ons-list> ɾng-show ɹɹ͕݅trueͷ߹ʹදࣔ͢Δ <ons-list> <ons-list-item ng-repeat=“data in dataList”> <span ng-show=“dataList.length > 0”>{{ data}} </span> </ons-list-item> </ons-list> -
σΟϨΫςΟϒʢ̎ʣ ɾng-click ɹɹΫϦοΫ࣌ʹࢦఆͨ͠είʔϓʹ ɹɹఆٛ͞ΕͨؔΛݺͼग़͢ <ons-button ng-click="search()"> ɹݕࡧ͢Δ </ons-button> $scope.search =
function() { ɾɾɾ }; ৄ͘͠ɺ js STUDIO(http://js.studio-kingdom.com/angularjs) -
Cordovaʢ̎ʣ ɾInAppBrowser ɹɹΞϓϦͰϒϥβΛ։͘ ɾGeolocation ɹɹҐஔใͷऔಘ navigator.geolocation.getCurrentPosition (geolocationSuccess, [geolocationError],[geolocationOptions]); window.open(url, '_blank',
'location=no'); ɾDevice ɹɹՃηϯαʔͷΞΫηε ɾMedia ɹɹΦʔσΟΦϑΝΠϧͷ࠶ੜɺԻ -
͙ΔͳͼAPI [ϦΫΤετύϥϝλ] ɹɾkeyid: ΞΫηεΩʔ ɹɾformat: ʮjsonʯ(ϦΫΤετͷσʔλܗࣜ) ɹɾlatitude: ݱࡏͷҢ ɹɾlongitude: ݱࡏͷܦ
ɹɾrange: ʮ1ʯ(ݕࡧൣғΛ൪߸Ͱࢦఆɻʮ1ʯɺ300m) ɾݕࡧ݁ՌΛදࣔ ɾ͓ؾʹೖΓҰཡΛදࣔ [ϦΫΤετύϥϝλ] ɹɾkeyid: ΞΫηεΩʔ ɹɾformat: ʮjsonʯ(ϦΫΤετͷσʔλܗࣜ) ɹɾid: දࣔ͢ΔళฮIDʢܗࣜɺʮ1,2,3ʯʣ -
ReactΞϓϦ(Meteor)ͷαϯϓϧ ɾMeteorΛΠϯετʔϧ ɹɹcurl https://install.meteor.com/ | sh ɾgithub͔ΒΫϩʔϯ ɹɹgit clone https://github.com/KazuhiroYoshimoto/react-sample
ɾNode.jsͷreact,react-domϞδϡʔϧΛΠϯετʔϧ ɹɹmeteor npm install --save react react-dom ɾMeteorΛىಈ ɹɹmeteor -
React.js ɾFacebook͕࡞ͬͨViewͷϥΠϒϥϦ ɾϑϨʔϜϫʔΫͰͳ͘ɺUIϥΠϒϥϦ ɾVirtual DOM ɹɹDOMͷঢ়ଶΛσʔλͱͯ࣋ͪ͠ɺ ɹɹঢ়ଶ͕มԽͨ͠ΒDOMΛ࠶ੜ͢Δ ɹɹʢࠩΛ࡞ʣ ɾίϯϙʔωϯτϕʔε ɾσʔλόΠσΟϯάʢpropsʣ
ɾঢ়ଶཧ(state) React.jsͰVirtual DOMΛఆٛ͢Δ -
ίϯϙʔωϯτϕʔε - App.jsx ɹ-Shop.jsx export default class Shop extends Component
{ render() { return ( ɹɹɾɾɾ ); } }); ίϯϙʔωϯτʹ DOMΛఆٛ͠ɺίϯ ϙʔωϯτΛΈ߹Θ ͤΔɻ ίϯϙʔωϯτͷఆٛ ʹै͍ɺDOM͕ੜ ͞ΕΔɻ export default class App extends Component { render() { return ( <div className="commentBox"> ɾɾɾ <Shop /> </div> ); } }); -
props export default class App extends Component { return (
<div className=”contaner"> <h1>Comments</h1> <Shop shop={this.data} /> </div> ); } }); export default class Shop extends Component { return ( <div className=“Comment"> ɹɹɹɹ{this.props.shop} </div> ); } }); App.jsx Shop.jsx ɾdataͷΛड͚͢ ɾAppͰdataΛߋ৽ͨ͠Βɺ ɹࣗಈతʹdataͷΛड͚͢ -
state export default class App extends Component { constructor(props) {
super(props); this.state = { isResult: false, shops : Array() }; } render:() { return ( ɾɾɾ ); } }); ɾίϯϙʔωϯτͷঢ়ଶΛͭɺϛϡʔλϒϧʢෆมʣͳ ɾίϯϙʔωϯτࣗͷঢ়ଶΛͭ { shops =[data1, data2] } stateʹରͯ͠ɺ ɾprops ΠϛϡʔλϒϧʢՄมʣͳ ɾpropsͷঢ়ଶΛͭ -
propsͱstate export default class App extends Component { render ()
{ return ( <div className=”container"> <Shop shop={this.state.data} /> </div> ); } }); {data: “͓ళ̍”} this.setState({data: “͓ళ2”}); export default class Shop extends Component { render() { return ( <li> <p> {this.props.shop} </p> </li> ); } } {data: “͓ళ2”} <div>͓ళ1</div> <div>͓ళ2</div> state DOM -
ɾMeteorΛΠϯετʔϧ ɹɹcurl https://install.meteor.com/ | sh ɾNode.jsͷreact,react-domϞδϡʔϧΛΠϯετʔϧ ɹɹmeteor npm install --save
react react-dom ɾmeteorΛىಈ ɹɹmeteor ϓϩδΣΫτͷ࡞