Skip to content

Commit de48898

Browse files
Add Angular2Spa template
1 parent a553946 commit de48898

39 files changed

+1234
-0
lines changed

templates/Angular2Spa/.babelrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"presets": ["es2015"]
3+
}

templates/Angular2Spa/.gitignore

Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
## Ignore Visual Studio temporary files, build results, and
2+
## files generated by popular Visual Studio add-ons.
3+
4+
# User-specific files
5+
*.suo
6+
*.user
7+
*.userosscache
8+
*.sln.docstates
9+
10+
# User-specific files (MonoDevelop/Xamarin Studio)
11+
*.userprefs
12+
13+
# Build results
14+
[Dd]ebug/
15+
[Dd]ebugPublic/
16+
[Rr]elease/
17+
[Rr]eleases/
18+
x64/
19+
x86/
20+
build/
21+
bld/
22+
[Bb]in/
23+
[Oo]bj/
24+
25+
# Visual Studio 2015 cache/options directory
26+
.vs/
27+
/wwwroot/dist/
28+
29+
# MSTest test Results
30+
[Tt]est[Rr]esult*/
31+
[Bb]uild[Ll]og.*
32+
33+
# NUNIT
34+
*.VisualState.xml
35+
TestResult.xml
36+
37+
# Build Results of an ATL Project
38+
[Dd]ebugPS/
39+
[Rr]eleasePS/
40+
dlldata.c
41+
42+
# DNX
43+
project.lock.json
44+
artifacts/
45+
46+
*_i.c
47+
*_p.c
48+
*_i.h
49+
*.ilk
50+
*.meta
51+
*.obj
52+
*.pch
53+
*.pdb
54+
*.pgc
55+
*.pgd
56+
*.rsp
57+
*.sbr
58+
*.tlb
59+
*.tli
60+
*.tlh
61+
*.tmp
62+
*.tmp_proj
63+
*.log
64+
*.vspscc
65+
*.vssscc
66+
.builds
67+
*.pidb
68+
*.svclog
69+
*.scc
70+
71+
# Chutzpah Test files
72+
_Chutzpah*
73+
74+
# Visual C++ cache files
75+
ipch/
76+
*.aps
77+
*.ncb
78+
*.opendb
79+
*.opensdf
80+
*.sdf
81+
*.cachefile
82+
83+
# Visual Studio profiler
84+
*.psess
85+
*.vsp
86+
*.vspx
87+
*.sap
88+
89+
# TFS 2012 Local Workspace
90+
$tf/
91+
92+
# Guidance Automation Toolkit
93+
*.gpState
94+
95+
# ReSharper is a .NET coding add-in
96+
_ReSharper*/
97+
*.[Rr]e[Ss]harper
98+
*.DotSettings.user
99+
100+
# JustCode is a .NET coding add-in
101+
.JustCode
102+
103+
# TeamCity is a build add-in
104+
_TeamCity*
105+
106+
# DotCover is a Code Coverage Tool
107+
*.dotCover
108+
109+
# NCrunch
110+
_NCrunch_*
111+
.*crunch*.local.xml
112+
nCrunchTemp_*
113+
114+
# MightyMoose
115+
*.mm.*
116+
AutoTest.Net/
117+
118+
# Web workbench (sass)
119+
.sass-cache/
120+
121+
# Installshield output folder
122+
[Ee]xpress/
123+
124+
# DocProject is a documentation generator add-in
125+
DocProject/buildhelp/
126+
DocProject/Help/*.HxT
127+
DocProject/Help/*.HxC
128+
DocProject/Help/*.hhc
129+
DocProject/Help/*.hhk
130+
DocProject/Help/*.hhp
131+
DocProject/Help/Html2
132+
DocProject/Help/html
133+
134+
# Click-Once directory
135+
publish/
136+
137+
# Publish Web Output
138+
*.[Pp]ublish.xml
139+
*.azurePubxml
140+
# TODO: Comment the next line if you want to checkin your web deploy settings
141+
# but database connection strings (with potential passwords) will be unencrypted
142+
*.pubxml
143+
*.publishproj
144+
145+
# NuGet Packages
146+
*.nupkg
147+
# The packages folder can be ignored because of Package Restore
148+
**/packages/*
149+
# except build/, which is used as an MSBuild target.
150+
!**/packages/build/
151+
# Uncomment if necessary however generally it will be regenerated when needed
152+
#!**/packages/repositories.config
153+
154+
# Microsoft Azure Build Output
155+
csx/
156+
*.build.csdef
157+
158+
# Microsoft Azure Emulator
159+
ecf/
160+
rcf/
161+
162+
# Microsoft Azure ApplicationInsights config file
163+
ApplicationInsights.config
164+
165+
# Windows Store app package directory
166+
AppPackages/
167+
BundleArtifacts/
168+
169+
# Visual Studio cache files
170+
# files ending in .cache can be ignored
171+
*.[Cc]ache
172+
# but keep track of directories ending in .cache
173+
!*.[Cc]ache/
174+
175+
# Others
176+
ClientBin/
177+
~$*
178+
*~
179+
*.dbmdl
180+
*.dbproj.schemaview
181+
*.pfx
182+
*.publishsettings
183+
node_modules/
184+
orleans.codegen.cs
185+
186+
# RIA/Silverlight projects
187+
Generated_Code/
188+
189+
# Backup & report files from converting an old project file
190+
# to a newer Visual Studio version. Backup files are not needed,
191+
# because we have git ;-)
192+
_UpgradeReport_Files/
193+
Backup*/
194+
UpgradeLog*.XML
195+
UpgradeLog*.htm
196+
197+
# SQL Server files
198+
*.mdf
199+
*.ldf
200+
201+
# Business Intelligence projects
202+
*.rdl.data
203+
*.bim.layout
204+
*.bim_*.settings
205+
206+
# Microsoft Fakes
207+
FakesAssemblies/
208+
209+
# GhostDoc plugin setting file
210+
*.GhostDoc.xml
211+
212+
# Node.js Tools for Visual Studio
213+
.ntvs_analysis.dat
214+
215+
# Visual Studio 6 build log
216+
*.plg
217+
218+
# Visual Studio 6 workspace options file
219+
*.opt
220+
221+
# Visual Studio LightSwitch build output
222+
**/*.HTMLClient/GeneratedArtifacts
223+
**/*.DesktopClient/GeneratedArtifacts
224+
**/*.DesktopClient/ModelManifest.xml
225+
**/*.Server/GeneratedArtifacts
226+
**/*.Server/ModelManifest.xml
227+
_Pvt_Extensions
228+
229+
# Paket dependency manager
230+
.paket/paket.exe
231+
232+
# FAKE - F# Make
233+
.fake/
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import 'bootstrap/dist/css/bootstrap.css';
2+
3+
import { bootstrap } from 'angular2/platform/browser';
4+
import { FormBuilder } from 'angular2/common';
5+
import * as router from 'angular2/router';
6+
import { Http, HTTP_PROVIDERS } from 'angular2/http';
7+
import { App } from './components/app/app';
8+
9+
bootstrap(App, [router.ROUTER_BINDINGS, HTTP_PROVIDERS, FormBuilder]);
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<h2>About</h2>
2+
3+
<p>Use this area to provide additional information.</p>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import * as ng from 'angular2/core';
2+
3+
@ng.Component({
4+
selector: 'about'
5+
})
6+
@ng.View({
7+
template: require('./about.html')
8+
})
9+
export class About {
10+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* Wrapping element */
2+
/* Set some basic padding to keep content from hitting the edges */
3+
.body-content {
4+
padding-top: 50px;
5+
padding-bottom: 20px;
6+
padding-left: 15px;
7+
padding-right: 15px;
8+
}
9+
10+
/* Set widths on the form inputs since otherwise they're 100% wide */
11+
input,
12+
select,
13+
textarea {
14+
max-width: 280px;
15+
}
16+
17+
/* Carousel */
18+
.carousel-caption p {
19+
font-size: 20px;
20+
line-height: 1.4;
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<div class="navbar navbar-inverse navbar-fixed-top">
2+
<div class="container">
3+
<div class="navbar-header">
4+
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
5+
<span class="sr-only">Toggle navigation</span>
6+
<span class="icon-bar"></span>
7+
<span class="icon-bar"></span>
8+
<span class="icon-bar"></span>
9+
</button>
10+
<a class="navbar-brand" [routerLink]="['/Home']">WebApplicationBasic</a>
11+
</div>
12+
<div class="navbar-collapse collapse">
13+
<ul class="nav navbar-nav">
14+
<li><a [routerLink]="['/Home']">Home</a></li>
15+
<li><a [routerLink]="['/About']">About</a></li>
16+
<li><a [routerLink]="['/Counter']">Counter</a></li>
17+
</ul>
18+
</div>
19+
</div>
20+
</div>
21+
22+
<div class="container body-content">
23+
<router-outlet></router-outlet>
24+
<hr />
25+
<footer>
26+
<p>&copy; 2016 - WebApplicationBasic</p>
27+
</footer>
28+
</div>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import * as ng from 'angular2/core';
2+
import * as router from 'angular2/router';
3+
import { Http, HTTP_BINDINGS } from 'angular2/http';
4+
import { Home } from '../home/home.ts';
5+
import { About } from '../about/about';
6+
import { Counter } from '../counter/counter';
7+
8+
@ng.Component({
9+
selector: 'app'
10+
})
11+
@router.RouteConfig([
12+
{ path: '/', component: Home, name: 'Home' },
13+
{ path: '/about', component: About, name: 'About' },
14+
{ path: '/counter', component: Counter, name: 'Counter' }
15+
])
16+
@ng.View({
17+
template: require('./app.html'),
18+
styles: [require('./app.css')],
19+
directives: [router.ROUTER_DIRECTIVES]
20+
})
21+
export class App {
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<h2>Counter</h2>
2+
3+
<p>This is a simple example of an Angular 2 component.</p>
4+
5+
<p>Current count: <strong>{{ currentCount }}</strong></p>
6+
7+
<button (click)="incrementCounter()">Increment</button>
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as ng from 'angular2/core';
2+
3+
@ng.Component({
4+
selector: 'counter'
5+
})
6+
@ng.View({
7+
template: require('./counter.html')
8+
})
9+
export class Counter {
10+
public currentCount = 0;
11+
12+
public incrementCounter() {
13+
this.currentCount++;
14+
}
15+
}

0 commit comments

Comments
 (0)