I am trying to use typescript in part of my angular application. I have a ts file describing a class User:
module App.Tools {
export class User {
name: string;
constructor(name: string) {
this.name = name;
}
}
}
And in my JS file (es2015) I try to import the class User:
import {User} from 'User.ts';
export default class AuthFactory {
/**
* @param {[type]}
* @return {[type]}
*/
constructor($firebaseAuth) {
this.ref = new Firebase("...");
// create an instance of the authentication service
this.auth = $firebaseAuth(this.ref);
var authData = this.auth.$getAuth();
if (authData) {
this.currentUser = new User(authData.google.displayName, authData.provider);
} else {
this.currentUser = null;
}
}
}
This doesn't work as I get an error : "User is not defined".
I am using gulp with browserify, tsify and babel.
.tsextension does not belong toimportstatement.