diff --git a/ASP.NET Core Basics/src/Aurelia/.gitignore b/ASP.NET Core Basics/src/Aurelia/.gitignore deleted file mode 100644 index bc5a6f3..0000000 --- a/ASP.NET Core Basics/src/Aurelia/.gitignore +++ /dev/null @@ -1,247 +0,0 @@ -/Properties/launchSettings.json - -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -build/ -bld/ -bin/ -Bin/ -obj/ -Obj/ - -# Visual Studio 2015 cache/options directory -.vs/ -/wwwroot/dist/** -/ClientApp/dist/** - -# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 -!/wwwroot/dist/_placeholder.txt -!/ClientApp/dist/_placeholder.txt - -/yarn.lock - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Microsoft Azure ApplicationInsights config file -ApplicationInsights.config - -# Windows Store app package directory -AppPackages/ -BundleArtifacts/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.pfx -*.publishsettings -orleans.codegen.cs - -# Workaround for https://github.com/aspnet/JavaScriptServices/issues/235 -/node_modules/** -!/node_modules/_placeholder.txt - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe - -# FAKE - F# Make -.fake/ diff --git a/ASP.NET Core Basics/src/Aurelia/Aurelia.csproj b/ASP.NET Core Basics/src/Aurelia/Aurelia.csproj index fe04d2b..eff4c62 100644 --- a/ASP.NET Core Basics/src/Aurelia/Aurelia.csproj +++ b/ASP.NET Core Basics/src/Aurelia/Aurelia.csproj @@ -1,22 +1,44 @@ - + + - netcoreapp1.1 + netcoreapp2.0 + TargetFrameworkOverride true + Latest false - 2.3 - - - - - - + + + + + + + + + + - - + - + + + + + + + + + + + + + + + + + @@ -31,4 +53,5 @@ - + + \ No newline at end of file diff --git a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/app/app.ts b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/app/app.ts index 85ed7ac..d6432af 100644 --- a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/app/app.ts +++ b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/app/app.ts @@ -1,4 +1,4 @@ -import { Aurelia } from 'aurelia-framework'; +import { Aurelia, PLATFORM } from 'aurelia-framework'; import { Router, RouterConfiguration } from 'aurelia-router'; export class App { @@ -10,21 +10,21 @@ export class App { route: ['', 'home'], name: 'home', settings: { icon: 'home' }, - moduleId: '../home/home', + moduleId: PLATFORM.moduleName('../home/home'), nav: true, title: 'Home' }, { route: 'counter', name: 'counter', settings: { icon: 'education' }, - moduleId: '../counter/counter', + moduleId: PLATFORM.moduleName('../counter/counter'), nav: true, title: 'Counter' }, { route: 'fetch-data', name: 'fetchdata', settings: { icon: 'th-list' }, - moduleId: '../fetchdata/fetchdata', + moduleId: PLATFORM.moduleName('../fetchdata/fetchdata'), nav: true, title: 'Fetch data' }, @@ -32,14 +32,14 @@ export class App { route: 'contact-list', name: 'contactlist', settings: { icon: 'list-alt' }, - moduleId: '../contacts/contactList', + moduleId: PLATFORM.moduleName('../contacts/contactList'), nav: true, title: 'Contact List' }, { route: 'contact-detail/:id?', name: 'contactdetail', - moduleId: '../contacts/contactDetail', + moduleId: PLATFORM.moduleName('../contacts/contactDetail'), nav: false, title: 'Contact Detail' }]); diff --git a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contact.ts b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contact.ts index bba82fd..c08d62a 100644 --- a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contact.ts +++ b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contact.ts @@ -8,7 +8,7 @@ phone: string; email: string; - constructor(data?) { + constructor(data?: any) { if (data == null) return; Object.assign(this, data); } diff --git a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactDetail.ts b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactDetail.ts index b2aac05..f30aaaa 100644 --- a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactDetail.ts +++ b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactDetail.ts @@ -9,12 +9,12 @@ export class ContactDetail { constructor(private contactService: ContactService) { } - activate(parms, routeConfig) { + activate(parms: any, routeConfig: any) { this.hasContactId = parms.id; if (this.hasContactId) { return this.contactService.getById(parms.id) - .then(contact => this.contact = contact); + .then(contact => this.contact = contact); } return null; diff --git a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactList.ts b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactList.ts index cf86835..e1478e6 100644 --- a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactList.ts +++ b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/contacts/contactList.ts @@ -5,7 +5,7 @@ import { ContactService } from './contactService'; @inject(ContactService) export class ContactList { contacts: Contact[]; - selectedContactId: number = null; + selectedContactId: number = -1; constructor(private contactService: ContactService) {} @@ -14,7 +14,7 @@ export class ContactList { .then(contacts => this.contacts = contacts); } - select(contact) { + select(contact: Contact) { this.selectedContactId = contact.id; } } \ No newline at end of file diff --git a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/counter/counter.html b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/counter/counter.html index ef4bf8f..7636a4f 100644 --- a/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/counter/counter.html +++ b/ASP.NET Core Basics/src/Aurelia/ClientApp/app/components/counter/counter.html @@ -1,5 +1,5 @@