TypeScript Default Exports

TypeScript Default Exports - What is default exports?

What is default export in TypeScript? Why we use it?

Default exports –
Each module can optionally export a default export and the default exports work with the keyword default and we can use only one default export per module.

Example -

export class User {
    //Todo your logic here..
And then -
import { User } from "./User";


export default "http://localhost:57431/Account/Login";

import BaseUrl from "../BaseUrl";
console.log(BaseUrl); //"http://localhost:57431/Account/Login"

Stayed Informed – Learn Angular 2 with TypeScript

I hope you are enjoying with this post! Please share with you friends. Thank you!!

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - http://code-sample.com and http://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
www.code-sample.com/. Powered by Blogger.
ASK Questions