Created
April 2, 2016 02:14
-
-
Save jonatan-alama/7b6408e196442c5a600e3d4c757f24a5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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