ASP.MVC_Angular

Details

angular.png 0(+0 -0)

diff --git a/angular.png b/angular.png
new file mode 100644
index 0000000..8937dee
Binary files /dev/null and b/angular.png differ
diff --git a/ASP.MVC Angular/.vs/ASP.MVC Angular/v15/.suo b/ASP.MVC Angular/.vs/ASP.MVC Angular/v15/.suo
index 5626c40..9fd0154 100644
Binary files a/ASP.MVC Angular/.vs/ASP.MVC Angular/v15/.suo and b/ASP.MVC Angular/.vs/ASP.MVC Angular/v15/.suo differ
diff --git a/ASP.MVC Angular/ASP.MVC Angular/src/app/app.component.ts b/ASP.MVC Angular/ASP.MVC Angular/src/app/app.component.ts
new file mode 100644
index 0000000..28d7356
--- /dev/null
+++ b/ASP.MVC Angular/ASP.MVC Angular/src/app/app.component.ts
@@ -0,0 +1,11 @@
+import { Component } from '@angular/core';
+
+@Component({
+    selector: 'my-app',
+    template: `<h1>Добро пожаловать {{name}}!</h1>
+                <label>Введите имя:</label>
+                <input [(ngModel)]="name" placeholder="name">`
+})
+export class AppComponent {
+    name = 'Tom';
+}
\ No newline at end of file
diff --git a/ASP.MVC Angular/ASP.MVC Angular/src/app/app.module.ts b/ASP.MVC Angular/ASP.MVC Angular/src/app/app.module.ts
new file mode 100644
index 0000000..eec4e57
--- /dev/null
+++ b/ASP.MVC Angular/ASP.MVC Angular/src/app/app.module.ts
@@ -0,0 +1,10 @@
+import { NgModule } from '@angular/core';
+import { BrowserModule } from '@angular/platform-browser';
+import { FormsModule } from '@angular/forms';
+import { AppComponent } from './app.component';
+@NgModule({
+    imports: [BrowserModule, FormsModule],
+    declarations: [AppComponent],
+    bootstrap: [AppComponent]
+})
+export class AppModule { }
\ No newline at end of file
diff --git a/ASP.MVC Angular/ASP.MVC Angular/src/main.ts b/ASP.MVC Angular/ASP.MVC Angular/src/main.ts
new file mode 100644
index 0000000..e9d996e
--- /dev/null
+++ b/ASP.MVC Angular/ASP.MVC Angular/src/main.ts
@@ -0,0 +1,4 @@
+import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
+import { AppModule } from './app/app.module';
+const platform = platformBrowserDynamic();
+platform.bootstrapModule(AppModule);
\ No newline at end of file
diff --git a/ASP.MVC Angular/ASP.MVC Angular/src/polyfills.ts b/ASP.MVC Angular/ASP.MVC Angular/src/polyfills.ts
new file mode 100644
index 0000000..4f503e7
--- /dev/null
+++ b/ASP.MVC Angular/ASP.MVC Angular/src/polyfills.ts
@@ -0,0 +1,5 @@
+import 'core-js/es6';
+// для поддержки Reflect Api
+import 'core-js/es7/reflect';
+// zone используется angular
+import 'zone.js/dist/zone';
\ No newline at end of file
diff --git a/ASP.MVC Angular/ASP.MVC Angular/webpack.config.js b/ASP.MVC Angular/ASP.MVC Angular/webpack.config.js
new file mode 100644
index 0000000..a92b78e
--- /dev/null
+++ b/ASP.MVC Angular/ASP.MVC Angular/webpack.config.js
@@ -0,0 +1,39 @@
+var path = require('path');
+var webpack = require('webpack');
+var UglifyJSPlugin = require('uglifyjs-webpack-plugin'); // плагин минимизации
+module.exports = {
+    entry: {
+        'polyfills': './src/polyfills.ts',
+        'app': './src/main.ts'
+    },
+    output: {
+        path: path.resolve(__dirname, './public'),     // путь к каталогу выходных файлов - папка public
+        publicPath: '/public/',
+        filename: "[name].js"       // название создаваемого файла
+    },
+    resolve: {
+        extensions: ['.ts', '.js']
+    },
+    module: {
+        rules: [   //загрузчик для ts
+            {
+                test: /\.ts$/, // определяем тип файлов
+                use: [
+                    {
+                        loader: 'awesome-typescript-loader',
+                        options: { configFileName: path.resolve(__dirname, 'tsconfig.json') }
+                    },
+                    'angular2-template-loader'
+                ]
+            }
+        ]
+    },
+    plugins: [
+        new webpack.ContextReplacementPlugin(
+            /angular(\\|\/)core/,
+            path.resolve(__dirname, 'src'), // каталог с исходными файлами
+            {} // карта маршрутов
+        ),
+        new UglifyJSPlugin()
+    ]
+}
\ No newline at end of file