I already have a pretty gigantic app running in aurelia 1.
So I started to play with aurelia 2 and it looks simplified and promising.
First hurdle I came across was my classes can not be exported in default mode
for example, this works
// sign-up.ts with a corresponding sign-up.html
export class SignUp {
private pageHeading: string;
constructor()
{
this.pageHeading = 'Sign Up';
}
}
but this fails
// sign-up.ts
class SignUp {
private pageHeading: string;
constructor()
{
this.pageHeading = 'Sign Up';
}
}
export default SignUp;
That means, I can no more do
import SignUp from './sign-up';
and I have to use
import {SignUp} from './sign-up';
That sounds weird because I believe aurelia has always been lot more standards compliant than any other framework.
Am I missing something?
this is the error I get in browser console with default export
Uncaught Error: No host element found.
at new CompositionRoot (aurelia.js:27)
at Aurelia.configureRoot (aurelia.js:200)
at Aurelia.app (aurelia.js:153)
at Aurelia.app (quick-start.js:51)
at Module../src/main.ts (main.ts:18)
at __webpack_require__ (bootstrap:19)
at Object.0 (main.ts:19)
at __webpack_require__ (bootstrap:19)
at bootstrap:83
at bootstrap:83