Skip to content

Instantly share code, notes, and snippets.

@jonatan-alama
Created April 2, 2016 02:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonatan-alama/7b6408e196442c5a600e3d4c757f24a5 to your computer and use it in GitHub Desktop.
Save jonatan-alama/7b6408e196442c5a600e3d4c757f24a5 to your computer and use it in GitHub Desktop.
interface IWebsite {
title: string;
url: string;
}
class WebSite {
private _title: string;
private _url: string;
constructor(website: IWebsite) {
this._title = website.title;
this._url = website.url;
}
}
new WebSite({ title: "aliolicode" }); // Error "Property 'url' is missing in type '{ title: string; }'"
new WebSite({ title: "aliolicode", url: "aliolicode.com"}); // OK
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment