├── .gitignore
├── src
├── main.ts
└── app
│ ├── a.directivet.ts
│ ├── a.component.ts
│ ├── app.component.ts
│ └── app.module.ts
├── db.json
├── remove-output-files.sh
├── README.md
├── tsconfig.json
├── index.html
├── package.json
└── systemjs.config.js
/.gitignore:
--------------------------------------------------------------------------------
1 | .idea
2 | node_modules
3 | src/**/*.js
4 | src/**/*.js.map
--------------------------------------------------------------------------------
/src/main.ts:
--------------------------------------------------------------------------------
1 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
2 | import { AppModule } from './app/app.module';
3 |
4 | platformBrowserDynamic().bootstrapModule(AppModule);
5 |
--------------------------------------------------------------------------------
/src/app/a.directivet.ts:
--------------------------------------------------------------------------------
1 | import {Directive, HostBinding} from "@angular/core";
2 |
3 | @Directive({
4 | selector: '[adir]'
5 | })
6 | export class ADirective {
7 | @HostBinding('style.color') color = 'green';
8 | }
9 |
--------------------------------------------------------------------------------
/src/app/a.component.ts:
--------------------------------------------------------------------------------
1 | import {Component} from '@angular/core';
2 |
3 | @Component({
4 | selector: 'a-comp',
5 | template: `
I am A component
`,
6 | styles: ['']
7 | })
8 | export class AComponent {
9 |
10 | }
11 |
--------------------------------------------------------------------------------
/db.json:
--------------------------------------------------------------------------------
1 | {
2 | "posts": [
3 | {
4 | "id": 1,
5 | "title": "json-server",
6 | "author": "typicode"
7 | }
8 | ],
9 | "comments": [
10 | {
11 | "id": 1,
12 | "body": "some comment",
13 | "postId": 1
14 | }
15 | ]
16 | }
--------------------------------------------------------------------------------
/remove-output-files.sh:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env bash
2 |
3 | # removes *.js, *.js.map and *.d.ts files inside the `app` folder recursively
4 | find src -type d -name "node_modules" -prune -o -type f \( -name "*.js" -o -name "*.js.map" -o -name "*.d.ts" \) -exec rm -r "{}" \;
5 |
6 |
7 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | Angular seed
3 | ============
4 | This is basic Angular setup with the minimum required dependencies
5 |
6 | Running the app
7 | ---------------
8 |
9 | ```
10 | npm i
11 | npm start
12 | ```
13 |
14 | Open a browser and navigate to http://localhost:3000/
15 |
--------------------------------------------------------------------------------
/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "target": "es5",
4 | "module": "commonjs",
5 | "sourceMap": true,
6 | "skipLibCheck": true,
7 | "experimentalDecorators": true,
8 | "emitDecoratorMetadata": true
9 | },
10 | "includes": [
11 | "src/**/*.ts"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/src/app/app.component.ts:
--------------------------------------------------------------------------------
1 | import {Component, VERSION} from '@angular/core';
2 |
3 | @Component({
4 | selector: 'my-app',
5 | template: `
6 | Hello {{name}}
7 | A directive changes color to green
8 |
9 | `,
10 | styles: ['']
11 | })
12 | export class AppComponent {
13 | name = `Angular! v${VERSION.full}`
14 | }
15 |
--------------------------------------------------------------------------------
/src/app/app.module.ts:
--------------------------------------------------------------------------------
1 | import {NgModule} from '@angular/core';
2 | import {BrowserModule} from '@angular/platform-browser';
3 |
4 | import {AppComponent} from './app.component';
5 | import {AComponent} from "./a.component";
6 | import {ADirective} from "./a.directivet";
7 |
8 | @NgModule({
9 | imports: [BrowserModule],
10 | declarations: [AppComponent, AComponent, ADirective],
11 | bootstrap: [AppComponent]
12 | })
13 | export class AppModule {
14 | }
15 |
--------------------------------------------------------------------------------
/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Angular QuickStart
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
17 |
18 |
19 |
20 | Loading AppComponent content here ...
21 |
22 |
23 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-seed",
3 | "version": "1.0.0",
4 | "description": "",
5 | "main": "app/main.js",
6 | "scripts": {
7 | "start": "tsc && concurrently \"tsc -w\" \"json-server db.json --static . \" "
8 | },
9 | "author": "",
10 | "license": "ISC",
11 | "dependencies": {
12 | "@angular/common": "6.0.0",
13 | "@angular/compiler": "6.0.0",
14 | "@angular/core": "6.0.0",
15 | "@angular/platform-browser": "6.0.0",
16 | "@angular/platform-browser-dynamic": "6.0.0",
17 | "core-js": "2.5.5",
18 | "rxjs": "6.1.0",
19 | "systemjs": "0.21.3",
20 | "zone.js": "0.8.26"
21 | },
22 | "devDependencies": {
23 | "@types/node": "10.0.4",
24 | "concurrently": "3.5.1",
25 | "json-server": "0.12.2",
26 | "typescript": "2.8.3"
27 | }
28 | }
29 |
--------------------------------------------------------------------------------
/systemjs.config.js:
--------------------------------------------------------------------------------
1 | (function (global) {
2 | System.config({
3 | paths: {
4 | 'npm:': '/node_modules/'
5 | },
6 |
7 | map: {
8 | // maps plain `app` module to `app` package
9 | main: 'src/main.js',
10 | app: 'src/app',
11 |
12 | // angular bundles
13 | '@angular/core': 'npm:@angular/core/bundles/core.umd.js',
14 | '@angular/common': 'npm:@angular/common/bundles/common.umd.js',
15 | '@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
16 | '@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
17 | '@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
18 |
19 | 'rxjs': 'npm:rxjs',
20 | 'rxjs-compat': 'npm:rxjs-compat',
21 | 'rxjs/operators': 'npm:rxjs/operators',
22 | },
23 |
24 | packages: {
25 | 'src': {
26 | defaultExtension: 'js',
27 | meta: {
28 | '': {
29 | format: 'cjs'
30 | }
31 | }
32 | },
33 | 'rxjs': {main: 'index.js', defaultExtension: 'js'},
34 | 'rxjs/operators': {main: 'index.js', defaultExtension: 'js'}
35 | }
36 | });
37 | })(this);
38 |
--------------------------------------------------------------------------------