Skip to content
This repository was archived by the owner on Feb 17, 2024. It is now read-only.

Commit 2dab6aa

Browse files
committed
🎉 pre-release base starter
0 parents  commit 2dab6aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+5301
-0
lines changed

‎.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# http://editorconfig.org
2+
3+
root = true
4+
5+
[*]
6+
charset = utf-8
7+
indent_style = space
8+
indent_size = 2
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
insert_final_newline = false
15+
trim_trailing_whitespace = false

‎.gitignore

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
.idea
2+
.DS_Store
3+
morgan.log
4+
5+
# Built #
6+
/__build__/
7+
/__server_build__/
8+
/node_modules/
9+
/typings/
10+
/tsd_typings/
11+
/dist/
12+
/compiled/
13+
14+
# Node #
15+
npm-debug.log
16+
/npm-debug.log.*
17+
18+
# Webpack #
19+
webpack.records.json
20+
21+
# Angular #
22+
*.ngfactory.ts
23+
*.css.shim.ts
24+
*.ngsummary.json
25+
*.metadata.json
26+
*.shim.ngstyle.ts

‎.vscode/launch.json

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Launch",
6+
"type": "node",
7+
"request": "launch",
8+
"program": "${workspaceRoot}/dist/server/index.js",
9+
"stopOnEntry": false,
10+
"args": [],
11+
"cwd": "${workspaceRoot}",
12+
"preLaunchTask": null,
13+
"runtimeExecutable": null,
14+
"runtimeArgs": [
15+
"--nolazy"
16+
],
17+
"env": {
18+
"NODE_ENV": "development"
19+
},
20+
"externalConsole": false,
21+
"sourceMaps": false,
22+
"outDir": null
23+
},
24+
{
25+
"name": "Attach",
26+
"type": "node",
27+
"request": "attach",
28+
"port": 5858,
29+
"address": "localhost",
30+
"restart": false,
31+
"sourceMaps": false,
32+
"outDir": null,
33+
"localRoot": "${workspaceRoot}",
34+
"remoteRoot": null
35+
},
36+
{
37+
"name": "Attach to Process",
38+
"type": "node",
39+
"request": "attach",
40+
"processId": "${command.PickProcess}",
41+
"port": 5858,
42+
"sourceMaps": false,
43+
"outDir": null
44+
}
45+
]
46+
}

‎.vscode/settings.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.check.workspaceVersion": false
3+
}

‎README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<p align="center">
2+
<a href="http://courses.angularclass.com/courses/angular-2-fundamentals?utm_source=github-angular2-webpack-starter&utm_medium=open-source&utm_campaign=webpackstarter" target="_blank">
3+
<img width="438" alt="Angular 2 Fundamentals" src="https://cloud.githubusercontent.com/assets/1016365/17200649/085798c6-543c-11e6-8ad0-2484f0641624.png">
4+
</a>
5+
</p>
6+
7+
___
8+
9+
10+
# Angular Beyond Starter [![Universal Angular 2](https://img.shields.io/badge/universal-angular-brightgreen.svg?style=flat)](https://github.com/angularclass/angular-beyond-starter)
11+
> Angular Beyond starter kit for Angular 2 and Angular 4 using Angular Universal for Server-Side Rendering by @AngularClass
12+
13+
14+
15+
## Installation
16+
17+
* `npm install`
18+
19+
## Serve
20+
21+
* `npm start` to build your client app and start a web server
22+
* `npm run build` to prepare a distributable bundle
23+
24+
## Development
25+
* run `npm start` and `npm run watch` in two separate terminals to build your client app, start a web server, and allow file changes to update in realtime
26+
27+
## Watch files
28+
* `npm run watch` to build your client app and start a web server
29+
30+
## AoT and Prod
31+
* `npm run build:prod:ngc` to compile the ngfactory files and build prod
32+
33+
34+
35+
___
36+
37+
enjoy — **AngularClass**
38+
39+
<br><br>
40+
41+
[![AngularClass](https://cloud.githubusercontent.com/assets/1016365/9863770/cb0620fc-5af7-11e5-89df-d4b0b2cdfc43.png "Angular Class")](https://angularclass.com)
42+
##[AngularClass](https://angularclass.com)
43+
> Learn AngularJS, Angular 2, and Modern Web Development from the best.
44+
> Looking for corporate Angular training, want to host us, or Angular consulting? [email protected]
45+
46+
___
47+
48+
# License
49+
[MIT](/LICENSE)

‎app.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "Angular Beyond Starter",
3+
"description": "Angular Beyond starter kit for Angular 2 and Angular 4 using Angular Universal for Server-Side Rendering by @AngularClass",
4+
"repository": "https://github.com/angularclass/angular-beyond-starter",
5+
"logo": "https://cloud.githubusercontent.com/assets/1016365/10639063/138338bc-7806-11e5-8057-d34c75f3cafc.png",
6+
"env": {
7+
"NPM_CONFIG_PRODUCTION": {
8+
"description": "Install `webpack` and other development modules when deploying to allow full builds.",
9+
"value": "false"
10+
}
11+
}
12+
}

‎empty.js

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
NgProbeToken: {},
3+
_createConditionalRootRenderer: function(rootRenderer, extraTokens, coreTokens) {
4+
return rootRenderer;
5+
},
6+
__platform_browser_private__: {}
7+
};

‎nodemon.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"watch": [
3+
"dist",
4+
"src/index.html"
5+
],
6+
"ext" : "js ts json html"
7+
}

‎package.json

+100
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
{
2+
"name": "angular-beyond-starter",
3+
"version": "0.0.1",
4+
"description": "Angular Beyond starter kit for Angular 2 and Angular 4 using Angular Universal for Server-Side Rendering by @AngularClass",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/angularclass/angular-beyond-starter.git"
8+
},
9+
"scripts": {
10+
"watch": "webpack --watch",
11+
"watch:dev": "npm run server & npm run watch",
12+
"clean:dist": "rimraf dist",
13+
"clean:ngc": "rimraf **/*.ngfactory.ts **/*.css.shim.ts",
14+
"prebuild": "npm run clean:dist",
15+
"build": "webpack --progress",
16+
"build:prod:ngc": "npm run clean:ngc && npm run ngc && npm run clean:dist && npm run build:prod",
17+
"build:prod:ngc:json": "npm run clean:ngc && npm run ngc && npm run clean:dist && npm run build:prod:json",
18+
"build:prod": "webpack --config webpack.prod.config.ts",
19+
"build:prod:json": "webpack --config webpack.prod.config.ts --json | webpack-bundle-size-analyzer",
20+
"ngc": "ngc -p tsconfig.aot.json",
21+
"prestart": "npm run build",
22+
"server": "nodemon dist/server/index.js",
23+
"debug:server": "node-nightly --inspect --debug-brk dist/server/index.js",
24+
"start": "npm run server",
25+
"debug:start": "npm run build && npm run debug:server",
26+
"predebug": "npm run build",
27+
"debug:build": "node --inspect --debug-brk node_modules/webpack/bin/webpack.js",
28+
"debug:build:prod": "node-nightly --inspect --debug-brk node_modules/webpack/bin/webpack.js --config webpack.prod.config.ts",
29+
"debug": "node --debug-brk dist/server/index.js"
30+
},
31+
"license": "MIT",
32+
"contributors": [
33+
"AngularClass <[email protected]>",
34+
"PatrickJS <[email protected]>",
35+
"Scott Moss <[email protected]>"
36+
],
37+
"dependencies": {
38+
"@angular/common": "~2.1.2",
39+
"@angular/compiler": "~2.1.2",
40+
"@angular/compiler-cli": "~2.1.2",
41+
"@angular/core": "~2.1.2",
42+
"@angular/forms": "~2.1.2",
43+
"@angular/http": "~2.1.2",
44+
"@angular/platform-browser": "~2.1.2",
45+
"@angular/platform-browser-dynamic": "~2.1.2",
46+
"@angular/platform-server": "~2.1.2",
47+
"@angular/router": "~3.1.2",
48+
"@angular/upgrade": "~2.1.2",
49+
"@angularclass/bootloader": "~1.0.1",
50+
"@angularclass/idle-preload": "~1.0.4",
51+
"angular2-express-engine": "~2.1.0-rc.1",
52+
"angular2-platform-node": "~2.1.0-rc.1",
53+
"angular2-universal": "~2.1.0-rc.1",
54+
"angular2-universal-polyfills": "~2.1.0-rc.1",
55+
"core-js": "2.4.1",
56+
"body-parser": "^1.15.2",
57+
"compression": "^1.6.2",
58+
"express": "^4.14.0",
59+
"js.clone": "0.0.3",
60+
"methods": "~1.1.2",
61+
"morgan": "^1.7.0",
62+
"preboot": "~4.5.2",
63+
"rxjs": "5.0.0-beta.12",
64+
"webfontloader": "^1.6.26",
65+
"zone.js": "~0.6.26"
66+
},
67+
"devDependencies": {
68+
"@types/morgan": "^1.7.32",
69+
"@types/body-parser": "0.0.29",
70+
"@types/compression": "0.0.29",
71+
"@types/cookie-parser": "^1.3.29",
72+
"@types/express": "^4.0.32",
73+
"@types/express-serve-static-core": "^4.0.33",
74+
"@types/hammerjs": "^2.0.32",
75+
"@types/mime": "0.0.28",
76+
"@types/node": "^6.0.38",
77+
"@types/serve-static": "^1.7.27",
78+
"@types/webfontloader": "^1.6.27",
79+
"@ngtools/webpack": "~1.1.7",
80+
"angular2-template-loader": "^0.4.0",
81+
"awesome-typescript-loader": "^2.2.4",
82+
"cookie-parser": "^1.4.3",
83+
"imports-loader": "^0.6.5",
84+
"json-loader": "^0.5.4",
85+
"nodemon": "^1.10.0",
86+
"raw-loader": "^0.5.1",
87+
"reflect-metadata": "0.1.8",
88+
"rimraf": "^2.5.4",
89+
"string-replace-loader": "^1.0.5",
90+
"ts-helpers": "^1.1.2",
91+
"ts-node": "^1.3.0",
92+
"typescript": "2.0.2",
93+
"v8-lazy-parse-webpack-plugin": "^0.3.0",
94+
"webpack": "2.1.0-beta.27",
95+
"webpack-bundle-analyzer": "1.4.1",
96+
"webpack-dev-middleware": "^1.8.4",
97+
"webpack-dev-server": "2.1.0-beta.11",
98+
"webpack-merge": "~0.16.0"
99+
}
100+
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NgModule } from '@angular/core';
2+
import { RouterModule } from '@angular/router';
3+
4+
import { HomeComponent } from './home.component';
5+
6+
@NgModule({
7+
imports: [
8+
RouterModule.forChild([
9+
{ path: 'home', component: HomeComponent }
10+
])
11+
]
12+
})
13+
export class HomeRoutingModule { }

‎src/+app/+home/home.component.css

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
blockquote {
2+
border-left:5px #158126 solid;
3+
background:#fff;
4+
padding:20px 20px 20px 40px;
5+
}
6+
blockquote::before {
7+
left: 1em;
8+
}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div class="home">
2+
Home component
3+
<strong>Async data call return value:</strong>
4+
<pre>{{ data | json }}</pre>
5+
<blockquote>{{ data.data }}</blockquote>
6+
</div>

‎src/+app/+home/home.component.ts

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import { Component, ChangeDetectionStrategy, ViewEncapsulation } from '@angular/core';
2+
3+
import { ModelService } from '../shared/model/model.service';
4+
5+
@Component({
6+
changeDetection: ChangeDetectionStrategy.Default,
7+
encapsulation: ViewEncapsulation.Emulated,
8+
selector: 'home',
9+
styleUrls: [ './home.component.css' ],
10+
templateUrl: './home.component.html'
11+
})
12+
export class HomeComponent {
13+
data: any = {};
14+
constructor(public model: ModelService) {
15+
16+
// we need the data synchronously for the client to set the server response
17+
// we create another method so we have more control for testing
18+
this.universalInit();
19+
}
20+
21+
universalInit() {
22+
this.model.get('/data.json').subscribe(data => {
23+
this.data = data;
24+
});
25+
}
26+
27+
}

‎src/+app/+home/home.module.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { NgModule } from '@angular/core';
2+
3+
import { SharedModule } from '../shared/shared.module';
4+
import { HomeComponent } from './home.component';
5+
import { HomeRoutingModule } from './home-routing.module';
6+
7+
import { HomeModel } from './model/home.model';
8+
9+
@NgModule({
10+
imports: [
11+
SharedModule,
12+
HomeRoutingModule
13+
],
14+
declarations: [
15+
HomeComponent
16+
],
17+
providers: [
18+
HomeModel
19+
]
20+
})
21+
export class HomeModule { }

0 commit comments

Comments
 (0)