This commit is contained in:
Le Deng
2017-03-08 11:22:28 -05:00
parent b1260fc682
commit 630d626613
7 changed files with 220 additions and 33 deletions

View File

@@ -159,7 +159,7 @@
</div>
<div class="row">
<div class="col-xs-12">
<img src="/image/creditcard.png" class="img-responsive" />
<img src="../../../assets/image/creditcard.png" class="img-responsive" />
<br/>
<div class="form-group">
<label for="cardType">* Select Card Type:</label>

View File

@@ -31,7 +31,9 @@ export class MyProfileComponent implements OnInit {
private user: User = new User();
private userPayment: UserPayment = new UserPayment();
private userBilling: UserBilling = new UserBilling();
private userBilling: UserBilling = new UserBilling();
private userPaymentList: UserPayment[] = [];
private stateList: string[] = [];
constructor (private loginService: LoginService, private userService: UserService, private router: Router){
}
@@ -102,11 +104,15 @@ export class MyProfileComponent implements OnInit {
res => {
console.log(res.json());
this.user=res.json();
this.userPaymentList = this.user.userPaymentList;
},
error => {
console.log(error);
}
);
for (let s in AppConst.usStates) {
this.stateList.push(s);
}
}
}

View File

@@ -1,3 +1,76 @@
export class AppConst {
export class AppConst implements OnInit {
public static serverPath='http://127.0.0.1:8181';
public static usStates = {
"AL": "Alabama",
"AK": "Alaska",
"AS": "American Samoa",
"AZ": "Arizona",
"AR": "Arkansas",
"CA": "California",
"CO": "Colorado",
"CT": "Connecticut",
"DE": "Delaware",
"DC": "District Of Columbia",
"FM": "Federated States Of Micronesia",
"FL": "Florida",
"GA": "Georgia",
"GU": "Guam",
"HI": "Hawaii",
"ID": "Idaho",
"IL": "Illinois",
"IN": "Indiana",
"IA": "Iowa",
"KS": "Kansas",
"KY": "Kentucky",
"LA": "Louisiana",
"ME": "Maine",
"MH": "Marshall Islands",
"MD": "Maryland",
"MA": "Massachusetts",
"MI": "Michigan",
"MN": "Minnesota",
"MS": "Mississippi",
"MO": "Missouri",
"MT": "Montana",
"NE": "Nebraska",
"NV": "Nevada",
"NH": "New Hampshire",
"NJ": "New Jersey",
"NM": "New Mexico",
"NY": "New York",
"NC": "North Carolina",
"ND": "North Dakota",
"MP": "Northern Mariana Islands",
"OH": "Ohio",
"OK": "Oklahoma",
"OR": "Oregon",
"PW": "Palau",
"PA": "Pennsylvania",
"PR": "Puerto Rico",
"RI": "Rhode Island",
"SC": "South Carolina",
"SD": "South Dakota",
"TN": "Tennessee",
"TX": "Texas",
"UT": "Utah",
"VT": "Vermont",
"VI": "Virgin Islands",
"VA": "Virginia",
"WA": "Washington",
"WV": "West Virginia",
"WI": "Wisconsin",
"WY": "Wyoming"
}
constructor () {
console.log("test");
for (let s in this.usStates) {
this.stateList.push(s);
console.log(s);
}
}
ngOnInit() {
}
}

View File

@@ -0,0 +1,16 @@
/* tslint:disable:no-unused-variable */
import { TestBed, async, inject } from '@angular/core/testing';
import { PaymentService } from './payment.service';
describe('PaymentService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [PaymentService]
});
});
it('should ...', inject([PaymentService], (service: PaymentService) => {
expect(service).toBeTruthy();
}));
});

View File

@@ -0,0 +1,14 @@
import { Injectable } from '@angular/core';
import {AppConst} from '../constants/app-const';
import {Http, Headers} from '@angular/http';
@Injectable()
export class PaymentService {
private serverPath:string = AppConst.serverPath;
constructor(private http:Http) { }
getUserPaymentlist() {
}
}