I am developing an Angular app with Nodejs and gulp. I have wrote my TypeScript file in client folder and my gulp task complete those file and place them in public folder.
Here is my components.ts file:
import {Component, View} from 'angular2/angular2';
import {FormBuilder, formDirectives } from 'angular2/forms';
@Component({
selector: 'login',
injectables: [FormBuilder]
})
@View({
templateUrl: '/scripts/src/components/login/login.html',
directives: [formDirectives]
})
export class login {
}
here is my bootstrap file:
import {bootstrap} from 'angular2/angular2';
import {login} from './components/login/login';
bootstrap(login);
Here is my index.html:
<!doctype HTML>
<html>
<head>
<script src="https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js"></script>
<script src="https://jspm.io/system@0.16.js"></script>
<script src="https://code.angularjs.org/2.0.0-alpha.26/angular2.dev.js"></script>
<script src="https://code.angularjs.org/2.0.0-alpha.27/router.dev.js"></script>
</head>
<body>
<div class="container">
<login></login>
</div>
<script>
System.import('scripts/src/bootstrap');
</script>
</body>
</html>
Here is my server.js file setting which lies in app folder
app.use(express.static(path.join(__dirname, '../public')));
But when I load my app in browser, I am unable to load the template.
Here is my file structure: