Commit 3789defa by Tobin

daily commit

parent 73d3cc08
......@@ -252,16 +252,17 @@
<div class="wizard_inner">
<wizard>
<wizard-step stepTitle="Title of step 1">
<form [formGroup]="vehicleDataForm" (ngSubmit)="getVehicleData(vehicleDataForm.value)">
<h3>VEHICLE INFORMATION</h3>
<div class="row">
<div class="col-md-6">
<select #modelYear>
<select formControlName="modelYear">
<option>YEAR</option>
<option *ngFor="let date of modelDates">{{date}}</option>
</select>
</div>
<div class="col-md-6">
<select (change)="get_model($event.target.value)" #maker>
<select (change)="get_model($event.target.value)" formControlName="maker">
<option>MAKE</option>
<option *ngFor="let car_date of carSearchJsonData; let key = index" value="{{key}}">{{car_date.brand}}</option>
</select>
......@@ -269,22 +270,22 @@
</div>
<div class="row">
<div class="col-md-6" >
<select #modelName>
<select formControlName="modelName">
<option *ngIf="!carModel">MODEL</option>
<option *ngFor="let car_models of carModel">{{car_models}}</option>
</select>
</div>
<div class="col-md-6">
<input #milage placeholder="APPROX VEHICLE MILEAGE" type="">
<input formControlName="milage" placeholder="APPROX VEHICLE MILEAGE" type="">
</div>
</div>
<h6 class="textLeft pb10">OPTIONAL</h6>
<div class="row">
<div class="col-md-6">
<input #emgine placeholder="ENGINE" type="">
<input formControlName="emgine" placeholder="ENGINE" type="">
</div>
<div class="col-md-6">
<input #trim placeholder="TRIM" type="">
<input formControlName="trim" placeholder="TRIM" type="">
</div>
</div>
<div class="row">
......@@ -295,12 +296,13 @@
<div class="row">
<div class="col-md-12">
<button class="log_btn prev_btn floatLeft" type="button" data-dismiss="modal">PREVIOUS</button>
<button class="log_btn next_btn floatRight" type="button" (click)="nextStep2()">
<button type="submit" class="log_btn next_btn floatRight">
NEXT
</button>
<!-- nextStep -->
</div>
</div>
</form>
</wizard-step>
<wizard-step stepTitle="Title of step 2" optionalStep>
<h3>SERVICES</h3>
......
......@@ -3,6 +3,7 @@ import { WebService } from '../../provider/web.service';
import { NgxCarousel } from 'ngx-carousel';
import { MapsAPILoader } from '@agm/core';
import { SubjectService } from '../../provider/subject.service';
import { FormGroup, FormControl, Validators, ValidationErrors } from '@angular/forms';
declare const google: any;
......@@ -31,12 +32,7 @@ export class IndexComponent implements OnInit {
@ViewChild("googleLocSearch") public searchElementRef: ElementRef;
//Vehicle Details: TAB 2
@ViewChild("trim") public trim: ElementRef;
@ViewChild("maker") public maker: ElementRef;
@ViewChild("emgine") public emgine: ElementRef;
@ViewChild("milage") public milage: ElementRef;
@ViewChild("modelName") public modelName: ElementRef;
@ViewChild("modelYear") public modelYear: ElementRef;
vehicleDataForm;
carModel: any;
carSearchJsonData: any;
......@@ -52,6 +48,15 @@ export class IndexComponent implements OnInit {
}
ngOnInit() {
this.vehicleDataForm = new FormGroup({
trim: new FormControl('', [Validators.required]),
maker: new FormControl('', [Validators.required]),
milage: new FormControl('', [Validators.required]),
emgine: new FormControl('', [Validators.required]),
modelYear: new FormControl('', [Validators.required]),
modelName: new FormControl('', [Validators.required])
});
this.webService.get_stored_json('car-list.json').subscribe((response: any) => {
this.carSearchJsonData = response;
});
......@@ -105,8 +110,8 @@ export class IndexComponent implements OnInit {
});
}
nextStep2(){
console.log(this.trim.nativeElement.value+' '+this.maker+' '+this.emgine+' '+this.milage+' '+this.modelName+' '+this.modelYear);
getVehicleData(vehicleData){
console.log(vehicleData);
}
featuredOnLoad() {return ''; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment