From e9a375705ae05d1e1ce526e7cbbed88012628502 Mon Sep 17 00:00:00 2001 From: usernamealreadyis Date: Wed, 30 Dec 2015 10:07:30 +0700 Subject: [PATCH] www.utc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Get full access to your messages and archives, upload files easily, and receive notifications whether you’re at your desk or on the go. First Header | Second Header ------------ | ------------- Content from cell 1 | Content from cell 2 Content in the first column | Content in the second column --- modules_dart/payload/hello_world/www.utc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 modules_dart/payload/hello_world/www.utc diff --git a/modules_dart/payload/hello_world/www.utc b/modules_dart/payload/hello_world/www.utc new file mode 100644 index 000000000000..9d428848cced --- /dev/null +++ b/modules_dart/payload/hello_world/www.utc @@ -0,0 +1,14 @@ +getCapitol(country){ + + //Can this be done differently? + if(this.pendingRequest){ + this.pendingRequest.unsubscribe(); + console.log('cancelled observable'); + } + + this.activeCountry = country; + + this.pendingRequest = this.http.get('./country-info/' + country + '.json') + .map((res: Response) => res.json()) + .subscribe(res => this.capitol = res.capitol); + }