diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 055727c..1cc07d0 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -1,6 +1,7 @@ + diff --git a/app/app.component.html b/app/app.component.html new file mode 100644 index 0000000..fe3799e --- /dev/null +++ b/app/app.component.html @@ -0,0 +1,3 @@ +
+ +
\ No newline at end of file diff --git a/app/app.component.ts b/app/app.component.ts index e049992..88bdfbe 100644 --- a/app/app.component.ts +++ b/app/app.component.ts @@ -1,6 +1,6 @@ import { Component } from '@angular/core'; @Component({ selector: 'my-app', - template: '

My First Angular App

' + templateUrl: 'app/app.component.html' }) export class AppComponent { } diff --git a/app/app.module.ts b/app/app.module.ts index 6c3b88c..9d1f7e9 100644 --- a/app/app.module.ts +++ b/app/app.module.ts @@ -1,9 +1,23 @@ import { NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; +import { FormsModule } from '@angular/forms'; +import { HttpModule } from '@angular/http'; + import { AppComponent } from './app.component'; +import { HomeComponent } from './home/home.component'; +import { routing } from './app.routes'; + @NgModule({ - imports: [BrowserModule], - declarations: [AppComponent], + imports: [ + BrowserModule, + FormsModule, + HttpModule, + routing + ], + declarations: [ + AppComponent, + HomeComponent + ], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/app/app.routes.ts b/app/app.routes.ts new file mode 100644 index 0000000..1bf39ae --- /dev/null +++ b/app/app.routes.ts @@ -0,0 +1,11 @@ +import { ModuleWithProviders } from '@angular/core'; +import { Routes, RouterModule } from '@angular/router'; + +import { HomeComponent } from './home/home.component'; + +const appRoutes: Routes = [ + { path: 'home', component: HomeComponent }, + { path: '', component: HomeComponent } +]; + +export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); \ No newline at end of file diff --git a/app/home/home.component.html b/app/home/home.component.html new file mode 100644 index 0000000..4ec7f86 --- /dev/null +++ b/app/home/home.component.html @@ -0,0 +1 @@ +

Home!!!

\ No newline at end of file diff --git a/app/home/home.component.ts b/app/home/home.component.ts new file mode 100644 index 0000000..9061366 --- /dev/null +++ b/app/home/home.component.ts @@ -0,0 +1,11 @@ +import { Component, OnInit } from '@angular/core'; + +@Component({ + selector: 'home', + templateUrl: 'app/home/home.component.html' +}) +export class HomeComponent implements OnInit { + constructor() { } + + ngOnInit() { } +} \ No newline at end of file diff --git a/gulpfile.js b/gulpfile.js index 680206c..e4f52b4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -25,8 +25,8 @@ paths.concatCssDest = paths.webroot + "css/site.min.css"; paths.lib = paths.webroot + "lib/"; -paths.angular = paths.node_modules + "@angular/**/*.js" -paths.angularWebApi = paths.node_modules + "angular2-in-memory-web-api/*.js" +paths.angular = paths.node_modules + "@angular/**/*.js"; +paths.angularWebApi = paths.node_modules + "angular2-in-memory-web-api/*.js"; paths.corejs = paths.node_modules + "core-js/client/shim*.js"; paths.zonejs = paths.node_modules + "zone.js/dist/zone*.js"; paths.reflectjs = paths.node_modules + "reflect-metadata/Reflect*.js"; @@ -64,7 +64,7 @@ gulp.task("copy:angular", function () { return gulp.src(paths.angular, { base: paths.node_modules + "@angular/" }) - .pipe(gulp.dest(paths.lib + "angular/")); + .pipe(gulp.dest(paths.lib + "@angular/")); }); gulp.task("copy:angularWebApi", function () { diff --git a/wwwroot/js/systemjs.config.js b/wwwroot/js/systemjs.config.js index 411eb7d..b2fcd7c 100644 --- a/wwwroot/js/systemjs.config.js +++ b/wwwroot/js/systemjs.config.js @@ -13,13 +13,14 @@ // our app is within the app folder app: 'app', // angular bundles - '@angular/core': 'npm:angular/core/bundles/core.umd.js', - '@angular/common': 'npm:angular/common/bundles/common.umd.js', - '@angular/compiler': 'npm:angular/compiler/bundles/compiler.umd.js', - '@angular/platform-browser': 'npm:angular/platform-browser/bundles/platform-browser.umd.js', - '@angular/platform-browser-dynamic': 'npm:angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', - '@angular/http': 'npm:angular/http/bundles/http.umd.js', - '@angular/forms': 'npm:angular/forms/bundles/forms.umd.js', + '@angular/core': 'npm:@angular/core/bundles/core.umd.js', + '@angular/common': 'npm:@angular/common/bundles/common.umd.js', + '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js', + '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js', + '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js', + '@angular/http': 'npm:@angular/http/bundles/http.umd.js', + '@angular/router': 'npm:@angular/router/bundles/router.umd.js', + '@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js', // other libraries 'rxjs': 'npm:rxjs', 'angular2-in-memory-web-api': 'npm:angular2-in-memory-web-api',