Understanding the distinction between export class xxx
and export default class xxx
is crucial.
However, I've noticed that numerous angular4
projects utilize export class xxx
in this manner:
@Component({
selector: 'call-record',
templateUrl: './collection.component.html',
styleUrls: ['./collection.component.css']
})
export class collection {
}
Perhaps using export default xxx
would be more appropriate if there is only one class or item to export?
This way, I could import it like so: import xxx from './somewhere'
instead of: import {xxx} from './somewhere'
.