When to use Interface and Model in TypeScript / Angular
interface User {
id: number;
username: string;
}
// inheritance
interface UserDetails extends User {
birthdate: Date;
biography?: string; // use the '?' annotation to mark this property as optionnal
}
getUsers() :Observable<User[]> {
return this.http.get<User[]>(url); // no need for '.map((res: Response) => res.json())'
}
public Post_signUp(name:string, id:string, password:string):Observable<number>{
let req_signup:Request_SignUp = {
name : name,
id : id,
password : password
};
return this.httpClient.post<number>('<http://localhost:8087/api/back/user/insertUser>',req_signup);
}