├── .gitignore ├── AspNetCoreAngular2.sln ├── LICENSE ├── README.md ├── global.json └── src └── AspNetCoreAngular2 ├── AspNetCoreAngular2.xproj ├── Backend └── ApiController.cs ├── Frontend ├── app │ ├── about │ │ ├── about.component.ts │ │ ├── about.module.ts │ │ └── about.routing.ts │ ├── app.component.ts │ ├── app.module.ts │ ├── app.routes.ts │ ├── home │ │ ├── hello.service.spec.ts │ │ ├── hello.service.ts │ │ ├── home.component.spec.ts │ │ ├── home.component.ts │ │ ├── home.module.ts │ │ └── home.routing.ts │ ├── main.ts │ ├── product │ │ ├── product-details.component.ts │ │ ├── product.component.ts │ │ ├── product.model.ts │ │ ├── product.module.ts │ │ ├── product.routing.ts │ │ ├── products-list.component.ts │ │ └── products.service.ts │ ├── shared │ │ ├── nav.component.ts │ │ └── shared.module.ts │ ├── styles │ │ └── main.scss │ ├── systemjs.config.js │ └── tests │ │ └── sanityTests.spec.ts ├── index.html └── test-main.js ├── Program.cs ├── Project_Readme.html ├── Properties └── launchSettings.json ├── Startup.cs ├── gulpfile.js ├── karma.conf.js ├── package.json ├── project.json ├── tsconfig.json ├── tslint.json ├── typings └── jasmine.d.ts └── web.config /.gitignore: -------------------------------------------------------------------------------- 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 | .idea 10 | node_modules 11 | wwwroot 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Build results 17 | [Dd]ebug/ 18 | [Dd]ebugPublic/ 19 | [Rr]elease/ 20 | [Rr]eleases/ 21 | x64/ 22 | x86/ 23 | bld/ 24 | [Bb]in/ 25 | [Oo]bj/ 26 | 27 | # Visual Studio 2015 cache/options directory 28 | .vs/ 29 | # Uncomment if you have tasks that create the project's static files in wwwroot 30 | #wwwroot/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | # NUNIT 37 | *.VisualState.xml 38 | TestResult.xml 39 | 40 | # Build Results of an ATL Project 41 | [Dd]ebugPS/ 42 | [Rr]eleasePS/ 43 | dlldata.c 44 | 45 | # DNX 46 | project.lock.json 47 | artifacts/ 48 | 49 | *_i.c 50 | *_p.c 51 | *_i.h 52 | *.ilk 53 | *.meta 54 | *.obj 55 | *.pch 56 | *.pdb 57 | *.pgc 58 | *.pgd 59 | *.rsp 60 | *.sbr 61 | *.tlb 62 | *.tli 63 | *.tlh 64 | *.tmp 65 | *.tmp_proj 66 | *.log 67 | *.vspscc 68 | *.vssscc 69 | .builds 70 | *.pidb 71 | *.svclog 72 | *.scc 73 | 74 | # Chutzpah Test files 75 | _Chutzpah* 76 | 77 | # Visual C++ cache files 78 | ipch/ 79 | *.aps 80 | *.ncb 81 | *.opendb 82 | *.opensdf 83 | *.sdf 84 | *.cachefile 85 | 86 | # Visual Studio profiler 87 | *.psess 88 | *.vsp 89 | *.vspx 90 | *.sap 91 | 92 | # TFS 2012 Local Workspace 93 | $tf/ 94 | 95 | # Guidance Automation Toolkit 96 | *.gpState 97 | 98 | # ReSharper is a .NET coding add-in 99 | _ReSharper*/ 100 | *.[Rr]e[Ss]harper 101 | *.DotSettings.user 102 | 103 | # JustCode is a .NET coding add-in 104 | .JustCode 105 | 106 | # TeamCity is a build add-in 107 | _TeamCity* 108 | 109 | # DotCover is a Code Coverage Tool 110 | *.dotCover 111 | 112 | # NCrunch 113 | _NCrunch_* 114 | .*crunch*.local.xml 115 | nCrunchTemp_* 116 | 117 | # MightyMoose 118 | *.mm.* 119 | AutoTest.Net/ 120 | 121 | # Web workbench (sass) 122 | .sass-cache/ 123 | 124 | # Installshield output folder 125 | [Ee]xpress/ 126 | 127 | # DocProject is a documentation generator add-in 128 | DocProject/buildhelp/ 129 | DocProject/Help/*.HxT 130 | DocProject/Help/*.HxC 131 | DocProject/Help/*.hhc 132 | DocProject/Help/*.hhk 133 | DocProject/Help/*.hhp 134 | DocProject/Help/Html2 135 | DocProject/Help/html 136 | 137 | # Click-Once directory 138 | publish/ 139 | 140 | # Publish Web Output 141 | *.[Pp]ublish.xml 142 | *.azurePubxml 143 | # TODO: Comment the next line if you want to checkin your web deploy settings 144 | # but database connection strings (with potential passwords) will be unencrypted 145 | *.pubxml 146 | *.publishproj 147 | 148 | # NuGet Packages 149 | *.nupkg 150 | # The packages folder can be ignored because of Package Restore 151 | **/packages/* 152 | # except build/, which is used as an MSBuild target. 153 | !**/packages/build/ 154 | # Uncomment if necessary however generally it will be regenerated when needed 155 | #!**/packages/repositories.config 156 | # NuGet v3's project.json files produces more ignoreable files 157 | *.nuget.props 158 | *.nuget.targets 159 | 160 | # Microsoft Azure Build Output 161 | csx/ 162 | *.build.csdef 163 | 164 | # Microsoft Azure Emulator 165 | ecf/ 166 | rcf/ 167 | 168 | # Microsoft Azure ApplicationInsights config file 169 | ApplicationInsights.config 170 | 171 | # Windows Store app package directory 172 | AppPackages/ 173 | BundleArtifacts/ 174 | 175 | # Visual Studio cache files 176 | # files ending in .cache can be ignored 177 | *.[Cc]ache 178 | # but keep track of directories ending in .cache 179 | !*.[Cc]ache/ 180 | 181 | # Others 182 | ClientBin/ 183 | ~$* 184 | *~ 185 | *.dbmdl 186 | *.dbproj.schemaview 187 | *.pfx 188 | *.publishsettings 189 | node_modules/ 190 | orleans.codegen.cs 191 | 192 | # RIA/Silverlight projects 193 | Generated_Code/ 194 | 195 | # Backup & report files from converting an old project file 196 | # to a newer Visual Studio version. Backup files are not needed, 197 | # because we have git ;-) 198 | _UpgradeReport_Files/ 199 | Backup*/ 200 | UpgradeLog*.XML 201 | UpgradeLog*.htm 202 | 203 | # SQL Server files 204 | *.mdf 205 | *.ldf 206 | 207 | # Business Intelligence projects 208 | *.rdl.data 209 | *.bim.layout 210 | *.bim_*.settings 211 | 212 | # Microsoft Fakes 213 | FakesAssemblies/ 214 | 215 | # GhostDoc plugin setting file 216 | *.GhostDoc.xml 217 | 218 | # Node.js Tools for Visual Studio 219 | .ntvs_analysis.dat 220 | 221 | # Visual Studio 6 build log 222 | *.plg 223 | 224 | # Visual Studio 6 workspace options file 225 | *.opt 226 | 227 | # Visual Studio LightSwitch build output 228 | **/*.HTMLClient/GeneratedArtifacts 229 | **/*.DesktopClient/GeneratedArtifacts 230 | **/*.DesktopClient/ModelManifest.xml 231 | **/*.Server/GeneratedArtifacts 232 | **/*.Server/ModelManifest.xml 233 | _Pvt_Extensions 234 | 235 | # Paket dependency manager 236 | .paket/paket.exe 237 | 238 | # FAKE - F# Make 239 | .fake/ 240 | 241 | Source/Domain/ProductModelSvc/ProductModelSvc.Test/DataFiles/ProductModelStore_StableData.sql 242 | 243 | *.ncrunchproject 244 | *.ncrunchsolution 245 | 246 | Source/NDependOut/ -------------------------------------------------------------------------------- /AspNetCoreAngular2.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.25420.1 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{E4A22F5E-F645-461A-96ED-5E8C4FE0C114}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{AC37BFE1-D758-444C-8328-9CE455404713}" 9 | ProjectSection(SolutionItems) = preProject 10 | global.json = global.json 11 | EndProjectSection 12 | EndProject 13 | Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "AspNetCoreAngular2", "src\AspNetCoreAngular2\AspNetCoreAngular2.xproj", "{CFB2D074-A06E-4FCC-9DE0-07AF37915480}" 14 | EndProject 15 | Global 16 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 17 | Debug|Any CPU = Debug|Any CPU 18 | Release|Any CPU = Release|Any CPU 19 | EndGlobalSection 20 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 21 | {CFB2D074-A06E-4FCC-9DE0-07AF37915480}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 22 | {CFB2D074-A06E-4FCC-9DE0-07AF37915480}.Debug|Any CPU.Build.0 = Debug|Any CPU 23 | {CFB2D074-A06E-4FCC-9DE0-07AF37915480}.Release|Any CPU.ActiveCfg = Release|Any CPU 24 | {CFB2D074-A06E-4FCC-9DE0-07AF37915480}.Release|Any CPU.Build.0 = Release|Any CPU 25 | EndGlobalSection 26 | GlobalSection(SolutionProperties) = preSolution 27 | HideSolutionNode = FALSE 28 | EndGlobalSection 29 | GlobalSection(NestedProjects) = preSolution 30 | {CFB2D074-A06E-4FCC-9DE0-07AF37915480} = {E4A22F5E-F645-461A-96ED-5E8C4FE0C114} 31 | EndGlobalSection 32 | EndGlobal 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | {one line to give the program's name and a brief idea of what it does.} 635 | Copyright (C) {year} {name of author} 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | {project} Copyright (C) {year} {fullname} 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | https://devblog.dymel.pl/2016/09/08/aspnet-core-with-angular2-tutorial/ 2 | https://devblog.dymel.pl/2016/09/19/testing-in-angular2/ 3 | https://devblog.dymel.pl/2016/09/29/angular2-modules/ -------------------------------------------------------------------------------- /global.json: -------------------------------------------------------------------------------- 1 | { 2 | "projects": [ "src", "test" ], 3 | "sdk": { 4 | "version": "1.0.0-preview2-003121" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/AspNetCoreAngular2.xproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 14.0 5 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 6 | 7 | 8 | 9 | 14.0 10 | $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) 11 | true 12 | 13 | 14 | 15 | 16 | cfb2d074-a06e-4fcc-9de0-07af37915480 17 | AspNetCoreAngular2 18 | .\obj 19 | .\bin\ 20 | v4.5.2 21 | 22 | 23 | 24 | 2.0 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Backend/ApiController.cs: -------------------------------------------------------------------------------- 1 | using Microsoft.AspNetCore.Mvc; 2 | 3 | namespace AspNetCoreAngular2.Backend 4 | { 5 | public class ApiController : Controller 6 | { 7 | [HttpGet] 8 | [Route("/api/hello")] 9 | public string Hello(string name) 10 | { 11 | return $"Hello {name}"; 12 | } 13 | } 14 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/about/about.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from "@angular/core"; 2 | 3 | @Component({ 4 | template: ` 5 | 6 |

About us

7 |

Here you can learn everything about us.

8 |

Date: {{today | date: short}}

` 9 | }) 10 | export class AboutComponent { 11 | today: Date; 12 | 13 | ngOnInit() { 14 | this.today = new Date(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/about/about.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from "@angular/core"; 2 | import {AboutComponent} from "./about.component"; 3 | import {SharedModule} from "../shared/shared.module"; 4 | import {routing} from "./about.routing"; 5 | 6 | @NgModule({ 7 | declarations: [AboutComponent], 8 | imports: [SharedModule, routing], 9 | exports: [AboutComponent] 10 | }) 11 | export class AboutModule {} 12 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/about/about.routing.ts: -------------------------------------------------------------------------------- 1 | import {RouterModule} from "@angular/router"; 2 | import {ModuleWithProviders} from "@angular/core"; 3 | import {AboutComponent} from "./about.component"; 4 | 5 | export const routing: ModuleWithProviders = RouterModule.forChild([ 6 | { path: "about", component: AboutComponent} 7 | ]); 8 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "app", 5 | template: `` 6 | }) 7 | export class AppComponent { } 8 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from "@angular/core"; 2 | import {BrowserModule} from "@angular/platform-browser"; 3 | import {AppComponent} from "./app.component"; 4 | import {routing} from "./app.routes"; 5 | import {HttpModule} from "@angular/http"; 6 | import {HomeModule} from "./home/home.module"; 7 | import {AboutModule} from "./about/about.module"; 8 | 9 | @NgModule({ 10 | imports: [ 11 | BrowserModule, 12 | HttpModule, 13 | routing, 14 | 15 | HomeModule, 16 | AboutModule 17 | ], 18 | declarations: [ 19 | AppComponent 20 | ], 21 | bootstrap: [AppComponent], 22 | }) 23 | export class AppModule {} -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import {Routes, RouterModule} from "@angular/router"; 2 | import {ModuleWithProviders} from "@angular/core"; 3 | 4 | const appRoutes: Routes = [ 5 | { path: "", redirectTo: "home", pathMatch: "full" }, 6 | { path: "product", loadChildren: "app/product/product.module#ProductModule" } 7 | ]; 8 | 9 | export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes); -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/home/hello.service.spec.ts: -------------------------------------------------------------------------------- 1 | import {Http, ConnectionBackend, BaseRequestOptions, ResponseOptions, Response} from "@angular/http"; 2 | import {MockBackend} from "@angular/http/testing"; 3 | import {HelloService} from "./hello.service"; 4 | import {TestBed, tick, fakeAsync, inject} from "@angular/core/testing"; 5 | 6 | describe("Hello Service", () => { 7 | 8 | beforeEach(() => { 9 | TestBed.configureTestingModule({ 10 | providers: [ 11 | { 12 | provide: Http, 13 | useFactory: (backend: ConnectionBackend, defaultOptions: BaseRequestOptions) => { 14 | return new Http(backend, defaultOptions); 15 | }, deps: [MockBackend, BaseRequestOptions] 16 | }, 17 | HelloService, 18 | MockBackend, 19 | BaseRequestOptions 20 | ] 21 | }); 22 | }); 23 | 24 | it("call the greet url", 25 | inject([HelloService, MockBackend], fakeAsync((helloService: HelloService, mockBackend: MockBackend) => { 26 | 27 | let name: string = "Michal"; 28 | let response: string; 29 | mockBackend.connections.subscribe(c => { 30 | expect(c.request.url).toBe("/api/hello?name=" + name); 31 | c.mockRespond(new Response(new ResponseOptions({body: "Hello " + name}))); 32 | }); 33 | helloService.greet(name).subscribe(data => { 34 | response = data; 35 | }); 36 | tick(); 37 | expect(response).toBe("Hello " + name); 38 | })) 39 | ); 40 | }); 41 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/home/hello.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from "@angular/core"; 2 | import {Http} from "@angular/http"; 3 | import {Observable, } from "rxjs/Rx"; 4 | import "rxjs/add/operator/map"; 5 | 6 | @Injectable() 7 | export class HelloService { 8 | 9 | constructor(private http: Http) { 10 | 11 | } 12 | 13 | greet(name: string): Observable { 14 | return this.http 15 | .get(`/api/hello?name=${name}`) 16 | .map(res => { 17 | return res.text(); 18 | }); 19 | } 20 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/home/home.component.spec.ts: -------------------------------------------------------------------------------- 1 | import {Observable} from "rxjs/Rx"; 2 | import {TestBed, async} from "@angular/core/testing"; 3 | import {HomeComponent} from "./home.component"; 4 | import {HelloService} from "./hello.service"; 5 | 6 | describe("Home Component", () => { 7 | let greet = "Hello Asd123"; 8 | let helloService; 9 | 10 | beforeEach(() => { 11 | helloService = { 12 | greet: jasmine.createSpy("greet").and.returnValue(Observable.of(greet)) 13 | }; 14 | 15 | TestBed.configureTestingModule({ 16 | declarations: [ 17 | HomeComponent 18 | ], 19 | providers: [ 20 | {provide: HelloService, useValue: helloService} 21 | ] 22 | }); 23 | }); 24 | 25 | it("can initialize", async(() => { 26 | TestBed.compileComponents().then(() => { 27 | const fixture = TestBed.createComponent(HomeComponent); 28 | let element = fixture.nativeElement; 29 | let component = fixture.componentInstance; 30 | 31 | fixture.detectChanges(); 32 | 33 | expect(element).not.toBeNull(); 34 | expect(component).not.toBeNull(); 35 | 36 | expect(helloService.greet).toHaveBeenCalled(); 37 | 38 | let header = element.querySelector("h1"); 39 | expect(header).not.toBeNull(); 40 | expect(header.textContent).toBe("Greeting test"); 41 | 42 | let greeting = element.querySelector("#greeting"); 43 | expect(greeting).not.toBeNull(); 44 | expect(greeting.textContent).toBe(greet); 45 | }); 46 | })); 47 | }); 48 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import { Component } from "@angular/core"; 2 | import {HelloService} from "./hello.service"; 3 | 4 | @Component({ 5 | template: ` 6 | 7 |

Greeting test

8 |

{{greeting}}

9 | ` 10 | }) 11 | export class HomeComponent { 12 | constructor(private helloService: HelloService) { 13 | } 14 | 15 | ngOnInit() { 16 | this.greet("Michal"); 17 | } 18 | 19 | greeting: string; 20 | 21 | greet(name: string): void { 22 | this.helloService 23 | .greet(name) 24 | .subscribe(data => this.greeting = data); 25 | } 26 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/home/home.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from "@angular/core"; 2 | import {HomeComponent} from "./home.component"; 3 | import {HelloService} from "./hello.service"; 4 | import {SharedModule} from "../shared/shared.module"; 5 | import {routing} from "./home.routing"; 6 | 7 | @NgModule({ 8 | declarations: [HomeComponent], 9 | imports: [SharedModule, routing], 10 | providers: [HelloService], 11 | exports: [HomeComponent] 12 | }) 13 | export class HomeModule {} 14 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/home/home.routing.ts: -------------------------------------------------------------------------------- 1 | import {RouterModule} from "@angular/router"; 2 | import {ModuleWithProviders} from "@angular/core"; 3 | import {HomeComponent} from "./home.component"; 4 | 5 | export const routing: ModuleWithProviders = RouterModule.forChild([ 6 | { path: "home", component: HomeComponent} 7 | ]); -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/main.ts: -------------------------------------------------------------------------------- 1 | import {platformBrowserDynamic} from "@angular/platform-browser-dynamic"; 2 | import {AppModule} from "./app.module"; 3 | 4 | platformBrowserDynamic().bootstrapModule(AppModule) 5 | .catch(err => console.error(err)); 6 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/product/product-details.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from "@angular/core"; 2 | import {ProductModel} from "./product.model"; 3 | import {ProductsService} from "./products.service"; 4 | import {ActivatedRoute} from "@angular/router"; 5 | 6 | @Component({ 7 | template: ` 8 |

Product Details

9 | Id: {{product.id}}
10 | Name: {{product.name}} 11 | ` 12 | }) 13 | export class ProductDetailsComponent { 14 | 15 | constructor( 16 | private route: ActivatedRoute, 17 | private productsService: ProductsService) { 18 | 19 | } 20 | 21 | product: ProductModel; 22 | 23 | ngOnInit() { 24 | let id = parseInt(this.route.snapshot.params["id"], 10); 25 | this.productsService 26 | .getProduct(id) 27 | .subscribe(data => this.product = data); 28 | } 29 | 30 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/product/product.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from "@angular/core"; 2 | 3 | @Component({ 4 | template: ` 5 | 6 |

Products

7 | 8 | ` 9 | }) 10 | export class ProductComponent {} -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/product/product.model.ts: -------------------------------------------------------------------------------- 1 | export class ProductModel { 2 | id: number; 3 | name: string; 4 | 5 | constructor(id: number, name: string) { 6 | this.id = id; 7 | this.name = name; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/product/product.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from "@angular/core"; 2 | import {SharedModule} from "../shared/shared.module"; 3 | import {ProductsService} from "./products.service"; 4 | import {ProductsListComponent} from "./products-list.component"; 5 | import {ProductDetailsComponent} from "./product-details.component"; 6 | import {routing} from "./product.routing"; 7 | import {ProductComponent} from "./product.component"; 8 | 9 | @NgModule({ 10 | declarations: [ProductComponent, ProductsListComponent, ProductDetailsComponent], 11 | imports: [SharedModule, routing], 12 | providers: [ProductsService], 13 | }) 14 | export class ProductModule {} 15 | 16 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/product/product.routing.ts: -------------------------------------------------------------------------------- 1 | import {RouterModule} from "@angular/router"; 2 | import {ModuleWithProviders} from "@angular/core"; 3 | import {ProductComponent} from "./product.component"; 4 | import {ProductsListComponent} from "./products-list.component"; 5 | import {ProductDetailsComponent} from "./product-details.component"; 6 | 7 | const routes = [ 8 | { 9 | path: "", 10 | component: ProductComponent, 11 | children: [ 12 | {path: "", component: ProductsListComponent}, 13 | {path: ":id", component: ProductDetailsComponent} 14 | ] 15 | } 16 | ]; 17 | 18 | export const routing: ModuleWithProviders = RouterModule.forChild(routes); 19 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/product/products-list.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from "@angular/core"; 2 | import {ProductModel} from "./product.model"; 3 | import {ProductsService} from "./products.service"; 4 | 5 | @Component({ 6 | template: ` 7 |

Products list

8 | 11 | ` 12 | }) 13 | export class ProductsListComponent { 14 | 15 | constructor(private productsService: ProductsService) { 16 | 17 | } 18 | 19 | products: ProductModel[]; 20 | 21 | ngOnInit() { 22 | this.productsService 23 | .getProducts() 24 | .subscribe(data => { 25 | this.products = data; 26 | }); 27 | } 28 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/product/products.service.ts: -------------------------------------------------------------------------------- 1 | import {Injectable} from "@angular/core"; 2 | import {Observable} from "rxjs/Rx"; 3 | import {ProductModel} from "./product.model"; 4 | 5 | @Injectable() 6 | export class ProductsService { 7 | 8 | products: ProductModel[] = [ 9 | new ProductModel(0, "Product 0"), 10 | new ProductModel(1, "Product 1"), 11 | new ProductModel(2, "Product 2"), 12 | new ProductModel(3, "Product 3"), 13 | new ProductModel(4, "Product 4"), 14 | ]; 15 | 16 | getProducts(): Observable { 17 | return Observable.of(this.products); 18 | } 19 | 20 | getProduct(id: number): Observable { 21 | return Observable.of(this.products[id]); 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/shared/nav.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from "@angular/core"; 2 | 3 | @Component({ 4 | selector: "my-nav", 5 | template: ` 6 | Home | 7 | About | 8 | Product 9 |
` 10 | }) 11 | export class NavComponent { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import {NgModule} from "@angular/core"; 2 | import {NavComponent} from "./nav.component"; 3 | import {CommonModule} from "@angular/common"; 4 | import {RouterModule} from "@angular/router"; 5 | 6 | @NgModule({ 7 | declarations: [NavComponent], 8 | imports: [CommonModule, RouterModule], 9 | exports: [CommonModule, NavComponent] 10 | }) 11 | export class SharedModule {} 12 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/styles/main.scss: -------------------------------------------------------------------------------- 1 | body { 2 | } 3 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/systemjs.config.js: -------------------------------------------------------------------------------- 1 | (function(global) { 2 | 3 | var map = { 4 | 'rxjs': '/node_modules/rxjs', 5 | '@angular': '/node_modules/@angular', 6 | 'app': "/app" 7 | }; 8 | 9 | var packages = { 10 | 'app': { main: 'main.js', defaultExtension: 'js' }, 11 | 'rxjs': { defaultExtension: 'js' } 12 | }; 13 | 14 | var ngPackageNames = [ 15 | 'common', 16 | 'compiler', 17 | 'core', 18 | 'http', 19 | 'forms', 20 | 'platform-browser', 21 | 'platform-browser-dynamic', 22 | 'router', 23 | 'testing', 24 | 'upgrade' 25 | ]; 26 | 27 | // Individual files (~300 requests): 28 | function packIndex(pkgName) { 29 | packages['@angular/' + pkgName] = { main: 'index.js', defaultExtension: 'js' }; 30 | } 31 | 32 | // Bundled (~40 requests): 33 | function packUmd(pkgName) { 34 | packages['@angular/' + pkgName] = { main: '/bundles/' + pkgName + '.umd.js', defaultExtension: 'js' }; 35 | } 36 | // Most environments should use UMD; some (Karma) need the individual index files 37 | var setPackageConfig = System.packageWithIndex ? packIndex : packUmd; 38 | // Add package entries for angular packages 39 | ngPackageNames.forEach(setPackageConfig); 40 | var config = { 41 | map: map, 42 | packages: packages 43 | }; 44 | System.config(config); 45 | 46 | })(this); -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/app/tests/sanityTests.spec.ts: -------------------------------------------------------------------------------- 1 | describe("universal truths", () => { 2 | it("should do math", () => { 3 | expect(1 + 1).toEqual(2); 4 | 5 | expect(5).toBeGreaterThan(4); 6 | }); 7 | }); 8 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/index.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | Demo Website 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 23 | 24 | Loading... 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Frontend/test-main.js: -------------------------------------------------------------------------------- 1 | // Turn on full stack traces in errors to help debugging 2 | Error.stackTraceLimit = Infinity; 3 | 4 | jasmine.DEFAULT_TIMEOUT_INTERVAL = 1000; 5 | 6 | // Cancel Karma's synchronous start, 7 | // we will call `__karma__.start()` later, once all the specs are loaded. 8 | __karma__.loaded = function () { }; 9 | 10 | function isJsFile(path) { 11 | return path.slice(-3) == '.js'; 12 | } 13 | 14 | function isSpecFile(path) { 15 | return path.slice(-8) == '.spec.js'; 16 | } 17 | 18 | function isBuiltFile(path) { 19 | var builtPath = '/base/wwwroot/'; 20 | return isJsFile(path) && (path.substr(0, builtPath.length) == builtPath); 21 | } 22 | 23 | var allSpecFiles = Object.keys(window.__karma__.files) 24 | .filter(isSpecFile) 25 | .filter(isBuiltFile); 26 | 27 | var map = { 28 | 'rxjs': 'node_modules/rxjs', 29 | '@angular': 'node_modules/@angular' 30 | }; 31 | 32 | var packages = { 33 | 'app': { main: 'main.js', defaultExtension: 'js' }, 34 | 'rxjs': { defaultExtension: 'js' } 35 | }; 36 | var packageNames = [ 37 | 'common', 38 | 'common/testing', 39 | 'compiler', 40 | 'compiler/testing', 41 | 'core', 42 | 'core/testing', 43 | 'http', 44 | 'http/testing', 45 | 'platform-browser', 46 | 'platform-browser/testing', 47 | 'platform-browser-dynamic', 48 | 'platform-browser-dynamic/testing', 49 | 'router', 50 | 'router/testing', 51 | 'forms' 52 | ]; 53 | 54 | // add package entries for angular packages in the form '@angular/common': { main: 'index.js', defaultExtension: 'js' } 55 | packageNames.forEach(function(pkgName) { 56 | packages["@angular/" + pkgName] = { main: 'index.js', defaultExtension: 'js' }; 57 | }); 58 | 59 | 60 | // Load our SystemJS configuration. 61 | System.config({ 62 | baseURL: '/base/', 63 | defaultJSExtensions: true, 64 | map: map, 65 | packages: packages 66 | }); 67 | 68 | Promise.all([ 69 | System.import('@angular/core/testing'), 70 | System.import('@angular/platform-browser-dynamic/testing') 71 | ]).then(function (providers) { 72 | var testing = providers[0]; 73 | var testingBrowser = providers[1]; 74 | 75 | testing.TestBed.initTestEnvironment( 76 | testingBrowser.BrowserDynamicTestingModule, 77 | testingBrowser.platformBrowserDynamicTesting()); 78 | 79 | }).then(function() { 80 | // Finally, load all spec files. 81 | // This will run the tests directly. 82 | return Promise.all( 83 | allSpecFiles.map(function (moduleName) { 84 | // console.log("importing " + moduleName); 85 | return System.import(moduleName); 86 | }) 87 | ); 88 | }).then(__karma__.start, __karma__.error); 89 | 90 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Threading.Tasks; 6 | using Microsoft.AspNetCore.Hosting; 7 | 8 | namespace AspNetCoreAngular2 9 | { 10 | public class Program 11 | { 12 | public static void Main(string[] args) 13 | { 14 | var host = new WebHostBuilder() 15 | .UseKestrel() 16 | .UseContentRoot(Directory.GetCurrentDirectory()) 17 | .UseIISIntegration() 18 | .UseStartup() 19 | .Build(); 20 | 21 | host.Run(); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Project_Readme.html: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Welcome to ASP.NET Core 6 | 127 | 128 | 129 | 130 | 138 | 139 |
140 |
141 |

This application consists of:

142 |
    143 |
  • Sample pages using ASP.NET Core MVC
  • 144 |
  • Bower for managing client-side libraries
  • 145 |
  • Theming using Bootstrap
  • 146 |
147 |
148 | 160 | 172 |
173 |

Run & Deploy

174 | 179 |
180 | 181 | 184 |
185 | 186 | 187 | 188 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "iisSettings": { 3 | "windowsAuthentication": false, 4 | "anonymousAuthentication": true, 5 | "iisExpress": { 6 | "applicationUrl": "http://localhost:51822/", 7 | "sslPort": 0 8 | } 9 | }, 10 | "profiles": { 11 | "IIS Express": { 12 | "commandName": "IISExpress", 13 | "launchBrowser": true, 14 | "environmentVariables": { 15 | "ASPNETCORE_ENVIRONMENT": "Development" 16 | } 17 | }, 18 | "AspNetCoreAngular2": { 19 | "commandName": "Project", 20 | "launchBrowser": true, 21 | "launchUrl": "http://localhost:5000", 22 | "environmentVariables": { 23 | "ASPNETCORE_ENVIRONMENT": "Development" 24 | } 25 | } 26 | } 27 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/Startup.cs: -------------------------------------------------------------------------------- 1 | using System.IO; 2 | using Microsoft.AspNetCore.Builder; 3 | using Microsoft.AspNetCore.Hosting; 4 | using Microsoft.AspNetCore.Http; 5 | using Microsoft.AspNetCore.Mvc; 6 | using Microsoft.Extensions.DependencyInjection; 7 | using Microsoft.Extensions.FileProviders; 8 | using Microsoft.Extensions.Logging; 9 | 10 | namespace AspNetCoreAngular2 11 | { 12 | public class Startup 13 | { 14 | public void ConfigureServices(IServiceCollection services) 15 | { 16 | services.AddMvc() 17 | .AddMvcOptions(options => 18 | { 19 | options.CacheProfiles.Add("NoCache", new CacheProfile 20 | { 21 | NoStore = true, 22 | Duration = 0 23 | }); 24 | }); 25 | } 26 | 27 | public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) 28 | { 29 | loggerFactory.AddConsole(); 30 | 31 | if (env.IsDevelopment()) 32 | { 33 | app.UseDeveloperExceptionPage(); 34 | } 35 | 36 | app.Use(async (context, next) => 37 | { 38 | await next(); 39 | 40 | if (context.Response.StatusCode == 404 && 41 | !Path.HasExtension(context.Request.Path.Value) && 42 | !context.Request.Path.Value.StartsWith("/node_modules/") && 43 | !context.Request.Path.Value.StartsWith("/api/")) 44 | { 45 | context.Request.Path = "/index.html"; 46 | await next(); 47 | } 48 | }); 49 | 50 | string libPath = Path.GetFullPath(Path.Combine(env.WebRootPath, @"..\node_modules\")); 51 | app.UseStaticFiles(new StaticFileOptions 52 | { 53 | FileProvider = new PhysicalFileProvider(libPath), 54 | RequestPath = new PathString("/node_modules") 55 | }); 56 | 57 | app.UseStaticFiles(new StaticFileOptions 58 | { 59 | #if DEBUG 60 | OnPrepareResponse = (context) => 61 | { 62 | // Disable caching of all static files. 63 | context.Context.Response.Headers["Cache-Control"] = "no-cache, no-store"; 64 | context.Context.Response.Headers["Pragma"] = "no-cache"; 65 | context.Context.Response.Headers["Expires"] = "-1"; 66 | } 67 | #endif 68 | }); 69 | 70 | app.UseMvc(); 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/gulpfile.js: -------------------------------------------------------------------------------- 1 | var gulp = require("gulp"); 2 | var path = require("path"); 3 | var sass = require("gulp-sass"); 4 | var ts = require("gulp-typescript"); 5 | var sourcemaps = require("gulp-sourcemaps"); 6 | var tslint = require("gulp-tslint"); 7 | var del = require('del'); 8 | var Builder = require('systemjs-builder'); 9 | 10 | var scriptsPath = "Frontend/**/*.ts"; 11 | var sassPath = "Frontend/**/*.scss"; 12 | var imagesPath = "Frontend/**/*.{jpg,gif,png,svg}"; 13 | var templatesPath = "Frontend/**/*.html"; 14 | var destPath = "wwwroot/"; 15 | 16 | gulp.task('clean', function () { 17 | return del([ 18 | destPath + "app" 19 | ]); 20 | }); 21 | 22 | gulp.task("typescript", function () { 23 | var tsProject = ts.createProject("tsconfig.json", { 24 | declarationFiles: true, 25 | noExternalResolve: true, 26 | isolatedModules: true 27 | }); 28 | 29 | var tsResult = 30 | gulp.src(scriptsPath) 31 | .pipe(sourcemaps.init()) 32 | .pipe(ts(tsProject)); 33 | 34 | tsResult.js 35 | .pipe(sourcemaps.write()) 36 | .pipe(gulp.dest(destPath)); 37 | }); 38 | 39 | gulp.task("tslint", function() { 40 | gulp.src(scriptsPath) 41 | .pipe(tslint({ 42 | formatter: "prose" 43 | })) 44 | .pipe(tslint.report( { 45 | emitError: false 46 | })); 47 | }); 48 | 49 | gulp.task("sass", function () { 50 | gulp.src(sassPath) 51 | .pipe(sass().on("error", sass.logError)) 52 | .pipe(gulp.dest(destPath)); 53 | }); 54 | 55 | gulp.task("images", function () { 56 | gulp.src(imagesPath) 57 | .pipe(gulp.dest(destPath)); 58 | }); 59 | 60 | gulp.task("templates", function () { 61 | gulp.src(templatesPath) 62 | .pipe(gulp.dest(destPath)); 63 | }); 64 | 65 | gulp.task("fonts", function () { 66 | gulp.src("Frontend/app/shared/styles/fonts/*") 67 | .pipe(gulp.dest(destPath + "app/shared/styles/fonts/")); 68 | }); 69 | 70 | gulp.task("static files", function () { 71 | gulp.src("Frontend/app/systemjs.config.js") 72 | .pipe(gulp.dest(destPath + "app/")); 73 | gulp.src("Frontend/app/index.html") 74 | .pipe(gulp.dest(destPath + "app/")); 75 | }); 76 | 77 | gulp.task('bundle', function() { 78 | var builder = new Builder('/', 'wwwroot/app/systemjs.config.js'); 79 | return Promise.all([ 80 | builder.buildStatic('wwwroot/app/home/boot.js', 'wwwroot/app/home/bundle.js', {minify: false, sourceMaps: false}), 81 | builder.buildStatic('wwwroot/app/passwordReset/boot.js', 'wwwroot/app/passwordReset/bundle.js', {minify: false, sourceMaps: false}), 82 | builder.buildStatic('wwwroot/app/fassaden/boot.js', 'wwwroot/app/fassaden/bundle.js', {minify: false, sourceMaps: false}), 83 | builder.buildStatic('wwwroot/app/lamellen/boot.js', 'wwwroot/app/lamellen/bundle.js', {minify: false, sourceMaps: false}) 84 | ]) 85 | .then(function() { 86 | console.log("bundles complete"); 87 | }) 88 | .catch(function(err) { 89 | console.log("bundles build error"); 90 | console.log(err); 91 | }) 92 | }); 93 | 94 | gulp.task("build", ['clean'], function() { 95 | gulp.start("static files"); 96 | gulp.start("sass"); 97 | gulp.start("typescript"); 98 | gulp.start("templates"); 99 | gulp.start("images"); 100 | gulp.start("fonts"); 101 | }); 102 | 103 | gulp.task("watch", ['clean', 'build'], function () { 104 | gulp.watch(sassPath, ["sass"]); 105 | gulp.watch(scriptsPath, ["typescript", "tslint"]); 106 | gulp.watch(templatesPath, ["templates"]); 107 | gulp.watch(imagesPath, ["images"]); 108 | }); 109 | 110 | 111 | gulp.task("default", function () { 112 | // place code for your default task here 113 | }); -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/karma.conf.js: -------------------------------------------------------------------------------- 1 | // Karma configuration 2 | 3 | module.exports = function (config) { 4 | config.set({ 5 | frameworks: ['jasmine'], 6 | 7 | files: [ 8 | 9 | // Polyfills. 10 | 'node_modules/core-js/client/shim.min.js', 11 | 12 | 'node_modules/traceur/bin/traceur.js', 13 | 14 | // 'node_modules/reflect-metadata/Reflect.js', 15 | 16 | // System.js for module loading 17 | 'node_modules/systemjs/dist/system-polyfills.js', 18 | 'node_modules/systemjs/dist/system.src.js', 19 | 20 | // Zone.js dependencies 21 | 'node_modules/zone.js/dist/zone.js', 22 | 'node_modules/zone.js/dist/long-stack-trace-zone.js', 23 | 'node_modules/zone.js/dist/async-test.js', 24 | 'node_modules/zone.js/dist/fake-async-test.js', 25 | 'node_modules/zone.js/dist/sync-test.js', 26 | 'node_modules/zone.js/dist/proxy.js', 27 | 'node_modules/zone.js/dist/jasmine-patch.js', 28 | 29 | // RxJs. 30 | { pattern: 'node_modules/rxjs/**/*.js', included: false, watched: false }, 31 | { pattern: 'node_modules/rxjs/**/*.js.map', included: false, watched: false }, 32 | 33 | 'Frontend/test-main.js', 34 | 35 | {pattern: 'node_modules/@angular/**/*.js', included: false, watched: true}, 36 | {pattern: 'node_modules/@angular/**/*.js.map', included: false, watched: true}, 37 | 38 | // {pattern: 'wwwroot/app/test/matchers.js', included: true, watched: true}, 39 | 40 | // Our built application code 41 | {pattern: 'wwwroot/app/**/*.js', included: false, watched: true}, 42 | 43 | // paths loaded via Angular's component compiler 44 | // (these paths need to be rewritten, see proxies section) 45 | //{pattern: 'wwwroot/app/**/*.html', included: false, watched: true}, 46 | //{pattern: 'wwwroot/app/**/*.css', included: false, watched: true}, 47 | 48 | // paths to support debugging with source maps in dev tools 49 | {pattern: 'Frontend/app/**/*.ts', included: false, watched: false}, 50 | 51 | ////images 52 | //{pattern: 'wwwroot/app/**/*.png', included: false, watched: false}, 53 | //{pattern: 'wwwroot/app/**/*.jpg', included: false, watched: false}, 54 | //{pattern: 'wwwroot/app/**/*.svg', included: false, watched: false} 55 | ], 56 | 57 | proxies: { 58 | "/app": "/base/wwwroot/app" 59 | }, 60 | 61 | exclude: [ 62 | 'node_modules/**/*_spec.js', 63 | ], 64 | 65 | reporters: ['mocha'], 66 | 67 | port: 9876, 68 | colors: true, 69 | logLevel: config.LOG_INFO, 70 | autoWatch: true, 71 | browsers: ['Chrome'], 72 | singleRun: false 73 | }); 74 | }; 75 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "demo-website", 3 | "version": "1.0.0", 4 | "dependencies": { 5 | "@angular/common": "2.0.0", 6 | "@angular/compiler": "2.0.0", 7 | "@angular/core": "2.0.0", 8 | "@angular/forms": "2.0.0", 9 | "@angular/http": "2.0.0", 10 | "@angular/platform-browser": "2.0.0", 11 | "@angular/platform-browser-dynamic": "2.0.0", 12 | "@angular/router": "3.0.0", 13 | 14 | "core-js": "2.4.1", 15 | "reflect-metadata": "0.1.3", 16 | "rxjs": "5.0.0-beta.12", 17 | "systemjs": "0.19.27", 18 | "zone.js": "0.6.23" 19 | }, 20 | "devDependencies": { 21 | "del": "latest", 22 | "gulp": "latest", 23 | "gulp-sass": "latest", 24 | "gulp-sourcemaps": "latest", 25 | "gulp-tslint": "latest", 26 | "gulp-typescript": "latest", 27 | "jasmine-core": "latest", 28 | "karma": "^1.3.0", 29 | "karma-chrome-launcher": "latest", 30 | "karma-coverage": "latest", 31 | "karma-jasmine": "latest", 32 | "karma-mocha-reporter": "latest", 33 | "karma-phantomjs2-launcher": "latest", 34 | "karma-story-reporter": "latest", 35 | "lite-server": "latest", 36 | "path": "latest", 37 | "phantomjs2": "latest", 38 | "require-dir": "latest", 39 | "systemjs-builder": "latest", 40 | "tslint": "latest", 41 | "typescript": "latest" 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "Microsoft.NETCore.App": { 4 | "version": "1.0.0", 5 | "type": "platform" 6 | }, 7 | "Microsoft.AspNetCore.Server.IISIntegration": "1.0.0", 8 | "Microsoft.AspNetCore.Diagnostics": "1.0.0", 9 | "Microsoft.AspNetCore.Mvc": "1.0.0", 10 | 11 | "Microsoft.AspNetCore.Server.Kestrel": "1.0.0", 12 | "Microsoft.Extensions.Logging.Console": "1.0.0", 13 | "Microsoft.AspNetCore.StaticFiles": "1.0.0" 14 | }, 15 | 16 | "tools": { 17 | "Microsoft.AspNetCore.Server.IISIntegration.Tools": "1.0.0-preview2-final" 18 | }, 19 | 20 | "frameworks": { 21 | "netcoreapp1.0": { 22 | "imports": [ 23 | "dotnet5.6", 24 | "portable-net45+win8" 25 | ] 26 | } 27 | }, 28 | 29 | "buildOptions": { 30 | "emitEntryPoint": true, 31 | "preserveCompilationContext": true 32 | }, 33 | 34 | "runtimeOptions": { 35 | "configProperties": { 36 | "System.GC.Server": true 37 | } 38 | }, 39 | 40 | "publishOptions": { 41 | "include": [ 42 | "wwwroot", 43 | "web.config" 44 | ] 45 | }, 46 | 47 | "scripts": { 48 | "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "target": "es5", 4 | "module": "system", 5 | "moduleResolution": "node", 6 | "sourceMap": true, 7 | "emitDecoratorMetadata": true, 8 | "experimentalDecorators": true, 9 | "removeComments": false, 10 | "noImplicitAny": false 11 | }, 12 | "exclude": [ 13 | "node_modules", 14 | "Frontend/typings" 15 | ] 16 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rules": { 3 | "class-name": true, 4 | "comment-format": [ 5 | true 6 | ], 7 | "indent": [ 8 | true, 9 | "spaces" 10 | ], 11 | "no-duplicate-variable": true, 12 | "no-eval": true, 13 | "no-internal-module": true, 14 | "no-trailing-whitespace": false, 15 | "no-var-keyword": true, 16 | "one-line": [ 17 | true, 18 | "check-open-brace", 19 | "check-whitespace" 20 | ], 21 | "quotemark": [ 22 | true, 23 | "double" 24 | ], 25 | "semicolon": [ 26 | true, 27 | "always" 28 | ], 29 | "triple-equals": [ 30 | true, 31 | "allow-null-check" 32 | ], 33 | "typedef-whitespace": [ 34 | true, 35 | { 36 | "call-signature": "nospace", 37 | "index-signature": "nospace", 38 | "parameter": "nospace", 39 | "property-declaration": "nospace", 40 | "variable-declaration": "nospace" 41 | } 42 | ], 43 | "variable-name": [ 44 | true, 45 | "ban-keywords" 46 | ], 47 | "whitespace": [ 48 | true, 49 | "check-branch", 50 | "check-decl", 51 | "check-operator", 52 | "check-separator", 53 | "check-type" 54 | ] 55 | } 56 | } -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/typings/jasmine.d.ts: -------------------------------------------------------------------------------- 1 | // Type definitions for Jasmine 2.2 2 | // Project: http://jasmine.github.io/ 3 | // Definitions by: Boris Yankov , Theodore Brown , David Pärsson 4 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped 5 | 6 | 7 | // For ddescribe / iit use : https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/karma-jasmine/karma-jasmine.d.ts 8 | 9 | declare function describe(description: string, specDefinitions: () => void): void; 10 | declare function fdescribe(description: string, specDefinitions: () => void): void; 11 | declare function xdescribe(description: string, specDefinitions: () => void): void; 12 | 13 | declare function it(expectation: string, assertion?: () => void, timeout?: number): void; 14 | declare function it(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; 15 | declare function fit(expectation: string, assertion?: () => void, timeout?: number): void; 16 | declare function fit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; 17 | declare function xit(expectation: string, assertion?: () => void, timeout?: number): void; 18 | declare function xit(expectation: string, assertion?: (done: DoneFn) => void, timeout?: number): void; 19 | 20 | /** If you call the function pending anywhere in the spec body, no matter the expectations, the spec will be marked pending. */ 21 | declare function pending(reason?: string): void; 22 | 23 | declare function beforeEach(action: () => void, timeout?: number): void; 24 | declare function beforeEach(action: (done: DoneFn) => void, timeout?: number): void; 25 | declare function afterEach(action: () => void, timeout?: number): void; 26 | declare function afterEach(action: (done: DoneFn) => void, timeout?: number): void; 27 | 28 | declare function beforeAll(action: () => void, timeout?: number): void; 29 | declare function beforeAll(action: (done: DoneFn) => void, timeout?: number): void; 30 | declare function afterAll(action: () => void, timeout?: number): void; 31 | declare function afterAll(action: (done: DoneFn) => void, timeout?: number): void; 32 | 33 | declare function expect(spy: Function): jasmine.Matchers; 34 | declare function expect(actual: any): jasmine.Matchers; 35 | 36 | declare function fail(e?: any): void; 37 | /** Action method that should be called when the async work is complete */ 38 | interface DoneFn extends Function { 39 | (): void; 40 | 41 | /** fails the spec and indicates that it has completed. If the message is an Error, Error.message is used */ 42 | fail: (message?: Error|string) => void; 43 | } 44 | 45 | declare function spyOn(object: any, method: string): jasmine.Spy; 46 | 47 | declare function runs(asyncMethod: Function): void; 48 | declare function waitsFor(latchMethod: () => boolean, failureMessage?: string, timeout?: number): void; 49 | declare function waits(timeout?: number): void; 50 | 51 | declare namespace jasmine { 52 | 53 | var clock: () => Clock; 54 | 55 | function any(aclass: any): Any; 56 | function anything(): Any; 57 | function arrayContaining(sample: any[]): ArrayContaining; 58 | function objectContaining(sample: any): ObjectContaining; 59 | function createSpy(name: string, originalFn?: Function): Spy; 60 | function createSpyObj(baseName: string, methodNames: any[]): any; 61 | function createSpyObj(baseName: string, methodNames: any[]): T; 62 | function pp(value: any): string; 63 | function getEnv(): Env; 64 | function addCustomEqualityTester(equalityTester: CustomEqualityTester): void; 65 | function addMatchers(matchers: CustomMatcherFactories): void; 66 | function stringMatching(str: string): Any; 67 | function stringMatching(str: RegExp): Any; 68 | 69 | interface Any { 70 | 71 | new (expectedClass: any): any; 72 | 73 | jasmineMatches(other: any): boolean; 74 | jasmineToString(): string; 75 | } 76 | 77 | // taken from TypeScript lib.core.es6.d.ts, applicable to CustomMatchers.contains() 78 | interface ArrayLike { 79 | length: number; 80 | [n: number]: T; 81 | } 82 | 83 | interface ArrayContaining { 84 | new (sample: any[]): any; 85 | 86 | asymmetricMatch(other: any): boolean; 87 | jasmineToString(): string; 88 | } 89 | 90 | interface ObjectContaining { 91 | new (sample: any): any; 92 | 93 | jasmineMatches(other: any, mismatchKeys: any[], mismatchValues: any[]): boolean; 94 | jasmineToString(): string; 95 | } 96 | 97 | interface Block { 98 | 99 | new (env: Env, func: SpecFunction, spec: Spec): any; 100 | 101 | execute(onComplete: () => void): void; 102 | } 103 | 104 | interface WaitsBlock extends Block { 105 | new (env: Env, timeout: number, spec: Spec): any; 106 | } 107 | 108 | interface WaitsForBlock extends Block { 109 | new (env: Env, timeout: number, latchFunction: SpecFunction, message: string, spec: Spec): any; 110 | } 111 | 112 | interface Clock { 113 | install(): void; 114 | uninstall(): void; 115 | /** Calls to any registered callback are triggered when the clock is ticked forward via the jasmine.clock().tick function, which takes a number of milliseconds. */ 116 | tick(ms: number): void; 117 | mockDate(date?: Date): void; 118 | } 119 | 120 | interface CustomEqualityTester { 121 | (first: any, second: any): boolean; 122 | } 123 | 124 | interface CustomMatcher { 125 | compare(actual: T, expected: T): CustomMatcherResult; 126 | compare(actual: any, expected: any): CustomMatcherResult; 127 | } 128 | 129 | interface CustomMatcherFactory { 130 | (util: MatchersUtil, customEqualityTesters: Array): CustomMatcher; 131 | } 132 | 133 | interface CustomMatcherFactories { 134 | [index: string]: CustomMatcherFactory; 135 | } 136 | 137 | interface CustomMatcherResult { 138 | pass: boolean; 139 | message?: string; 140 | } 141 | 142 | interface MatchersUtil { 143 | equals(a: any, b: any, customTesters?: Array): boolean; 144 | contains(haystack: ArrayLike | string, needle: any, customTesters?: Array): boolean; 145 | buildFailureMessage(matcherName: string, isNot: boolean, actual: any, ...expected: Array): string; 146 | } 147 | 148 | interface Env { 149 | setTimeout: any; 150 | clearTimeout: void; 151 | setInterval: any; 152 | clearInterval: void; 153 | updateInterval: number; 154 | 155 | currentSpec: Spec; 156 | 157 | matchersClass: Matchers; 158 | 159 | version(): any; 160 | versionString(): string; 161 | nextSpecId(): number; 162 | addReporter(reporter: Reporter): void; 163 | execute(): void; 164 | describe(description: string, specDefinitions: () => void): Suite; 165 | // ddescribe(description: string, specDefinitions: () => void): Suite; Not a part of jasmine. Angular team adds these 166 | beforeEach(beforeEachFunction: () => void): void; 167 | beforeAll(beforeAllFunction: () => void): void; 168 | currentRunner(): Runner; 169 | afterEach(afterEachFunction: () => void): void; 170 | afterAll(afterAllFunction: () => void): void; 171 | xdescribe(desc: string, specDefinitions: () => void): XSuite; 172 | it(description: string, func: () => void): Spec; 173 | // iit(description: string, func: () => void): Spec; Not a part of jasmine. Angular team adds these 174 | xit(desc: string, func: () => void): XSpec; 175 | compareRegExps_(a: RegExp, b: RegExp, mismatchKeys: string[], mismatchValues: string[]): boolean; 176 | compareObjects_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; 177 | equals_(a: any, b: any, mismatchKeys: string[], mismatchValues: string[]): boolean; 178 | contains_(haystack: any, needle: any): boolean; 179 | addCustomEqualityTester(equalityTester: CustomEqualityTester): void; 180 | addMatchers(matchers: CustomMatcherFactories): void; 181 | specFilter(spec: Spec): boolean; 182 | } 183 | 184 | interface FakeTimer { 185 | 186 | new (): any; 187 | 188 | reset(): void; 189 | tick(millis: number): void; 190 | runFunctionsWithinRange(oldMillis: number, nowMillis: number): void; 191 | scheduleFunction(timeoutKey: any, funcToCall: () => void, millis: number, recurring: boolean): void; 192 | } 193 | 194 | interface HtmlReporter { 195 | new (): any; 196 | } 197 | 198 | interface HtmlSpecFilter { 199 | new (): any; 200 | } 201 | 202 | interface Result { 203 | type: string; 204 | } 205 | 206 | interface NestedResults extends Result { 207 | description: string; 208 | 209 | totalCount: number; 210 | passedCount: number; 211 | failedCount: number; 212 | 213 | skipped: boolean; 214 | 215 | rollupCounts(result: NestedResults): void; 216 | log(values: any): void; 217 | getItems(): Result[]; 218 | addResult(result: Result): void; 219 | passed(): boolean; 220 | } 221 | 222 | interface MessageResult extends Result { 223 | values: any; 224 | trace: Trace; 225 | } 226 | 227 | interface ExpectationResult extends Result { 228 | matcherName: string; 229 | passed(): boolean; 230 | expected: any; 231 | actual: any; 232 | message: string; 233 | trace: Trace; 234 | } 235 | 236 | interface Trace { 237 | name: string; 238 | message: string; 239 | stack: any; 240 | } 241 | 242 | interface PrettyPrinter { 243 | 244 | new (): any; 245 | 246 | format(value: any): void; 247 | iterateObject(obj: any, fn: (property: string, isGetter: boolean) => void): void; 248 | emitScalar(value: any): void; 249 | emitString(value: string): void; 250 | emitArray(array: any[]): void; 251 | emitObject(obj: any): void; 252 | append(value: any): void; 253 | } 254 | 255 | interface StringPrettyPrinter extends PrettyPrinter { 256 | } 257 | 258 | interface Queue { 259 | 260 | new (env: any): any; 261 | 262 | env: Env; 263 | ensured: boolean[]; 264 | blocks: Block[]; 265 | running: boolean; 266 | index: number; 267 | offset: number; 268 | abort: boolean; 269 | 270 | addBefore(block: Block, ensure?: boolean): void; 271 | add(block: any, ensure?: boolean): void; 272 | insertNext(block: any, ensure?: boolean): void; 273 | start(onComplete?: () => void): void; 274 | isRunning(): boolean; 275 | next_(): void; 276 | results(): NestedResults; 277 | } 278 | 279 | interface Matchers { 280 | 281 | new (env: Env, actual: any, spec: Env, isNot?: boolean): any; 282 | 283 | env: Env; 284 | actual: any; 285 | spec: Env; 286 | isNot?: boolean; 287 | message(): any; 288 | 289 | toBe(expected: any, expectationFailOutput?: any): boolean; 290 | toEqual(expected: any, expectationFailOutput?: any): boolean; 291 | toMatch(expected: string | RegExp, expectationFailOutput?: any): boolean; 292 | toBeDefined(expectationFailOutput?: any): boolean; 293 | toBeUndefined(expectationFailOutput?: any): boolean; 294 | toBeNull(expectationFailOutput?: any): boolean; 295 | toBeNaN(): boolean; 296 | toBeTruthy(expectationFailOutput?: any): boolean; 297 | toBeFalsy(expectationFailOutput?: any): boolean; 298 | toHaveBeenCalled(): boolean; 299 | toHaveBeenCalledWith(...params: any[]): boolean; 300 | toHaveBeenCalledTimes(expected: number): boolean; 301 | toContain(expected: any, expectationFailOutput?: any): boolean; 302 | toBeLessThan(expected: number, expectationFailOutput?: any): boolean; 303 | toBeGreaterThan(expected: number, expectationFailOutput?: any): boolean; 304 | toBeCloseTo(expected: number, precision: any, expectationFailOutput?: any): boolean; 305 | toThrow(expected?: any): boolean; 306 | toThrowError(message?: string | RegExp): boolean; 307 | toThrowError(expected?: new (...args: any[]) => Error, message?: string | RegExp): boolean; 308 | not: Matchers; 309 | 310 | Any: Any; 311 | } 312 | 313 | interface Reporter { 314 | reportRunnerStarting(runner: Runner): void; 315 | reportRunnerResults(runner: Runner): void; 316 | reportSuiteResults(suite: Suite): void; 317 | reportSpecStarting(spec: Spec): void; 318 | reportSpecResults(spec: Spec): void; 319 | log(str: string): void; 320 | } 321 | 322 | interface MultiReporter extends Reporter { 323 | addReporter(reporter: Reporter): void; 324 | } 325 | 326 | interface Runner { 327 | 328 | new (env: Env): any; 329 | 330 | execute(): void; 331 | beforeEach(beforeEachFunction: SpecFunction): void; 332 | afterEach(afterEachFunction: SpecFunction): void; 333 | beforeAll(beforeAllFunction: SpecFunction): void; 334 | afterAll(afterAllFunction: SpecFunction): void; 335 | finishCallback(): void; 336 | addSuite(suite: Suite): void; 337 | add(block: Block): void; 338 | specs(): Spec[]; 339 | suites(): Suite[]; 340 | topLevelSuites(): Suite[]; 341 | results(): NestedResults; 342 | } 343 | 344 | interface SpecFunction { 345 | (spec?: Spec): void; 346 | } 347 | 348 | interface SuiteOrSpec { 349 | id: number; 350 | env: Env; 351 | description: string; 352 | queue: Queue; 353 | } 354 | 355 | interface Spec extends SuiteOrSpec { 356 | 357 | new (env: Env, suite: Suite, description: string): any; 358 | 359 | suite: Suite; 360 | 361 | afterCallbacks: SpecFunction[]; 362 | spies_: Spy[]; 363 | 364 | results_: NestedResults; 365 | matchersClass: Matchers; 366 | 367 | getFullName(): string; 368 | results(): NestedResults; 369 | log(arguments: any): any; 370 | runs(func: SpecFunction): Spec; 371 | addToQueue(block: Block): void; 372 | addMatcherResult(result: Result): void; 373 | expect(actual: any): any; 374 | waits(timeout: number): Spec; 375 | waitsFor(latchFunction: SpecFunction, timeoutMessage?: string, timeout?: number): Spec; 376 | fail(e?: any): void; 377 | getMatchersClass_(): Matchers; 378 | addMatchers(matchersPrototype: CustomMatcherFactories): void; 379 | finishCallback(): void; 380 | finish(onComplete?: () => void): void; 381 | after(doAfter: SpecFunction): void; 382 | execute(onComplete?: () => void): any; 383 | addBeforesAndAftersToQueue(): void; 384 | explodes(): void; 385 | spyOn(obj: any, methodName: string, ignoreMethodDoesntExist: boolean): Spy; 386 | removeAllSpies(): void; 387 | } 388 | 389 | interface XSpec { 390 | id: number; 391 | runs(): void; 392 | } 393 | 394 | interface Suite extends SuiteOrSpec { 395 | 396 | new (env: Env, description: string, specDefinitions: () => void, parentSuite: Suite): any; 397 | 398 | parentSuite: Suite; 399 | 400 | getFullName(): string; 401 | finish(onComplete?: () => void): void; 402 | beforeEach(beforeEachFunction: SpecFunction): void; 403 | afterEach(afterEachFunction: SpecFunction): void; 404 | beforeAll(beforeAllFunction: SpecFunction): void; 405 | afterAll(afterAllFunction: SpecFunction): void; 406 | results(): NestedResults; 407 | add(suiteOrSpec: SuiteOrSpec): void; 408 | specs(): Spec[]; 409 | suites(): Suite[]; 410 | children(): any[]; 411 | execute(onComplete?: () => void): void; 412 | } 413 | 414 | interface XSuite { 415 | execute(): void; 416 | } 417 | 418 | interface Spy { 419 | (...params: any[]): any; 420 | 421 | identity: string; 422 | and: SpyAnd; 423 | calls: Calls; 424 | mostRecentCall: { args: any[]; }; 425 | argsForCall: any[]; 426 | wasCalled: boolean; 427 | } 428 | 429 | interface SpyAnd { 430 | /** By chaining the spy with and.callThrough, the spy will still track all calls to it but in addition it will delegate to the actual implementation. */ 431 | callThrough(): Spy; 432 | /** By chaining the spy with and.returnValue, all calls to the function will return a specific value. */ 433 | returnValue(val: any): Spy; 434 | /** By chaining the spy with and.returnValues, all calls to the function will return specific values in order until it reaches the end of the return values list. */ 435 | returnValues(...values: any[]): Spy; 436 | /** By chaining the spy with and.callFake, all calls to the spy will delegate to the supplied function. */ 437 | callFake(fn: Function): Spy; 438 | /** By chaining the spy with and.throwError, all calls to the spy will throw the specified value. */ 439 | throwError(msg: string): Spy; 440 | /** When a calling strategy is used for a spy, the original stubbing behavior can be returned at any time with and.stub. */ 441 | stub(): Spy; 442 | } 443 | 444 | interface Calls { 445 | /** By chaining the spy with calls.any(), will return false if the spy has not been called at all, and then true once at least one call happens. **/ 446 | any(): boolean; 447 | /** By chaining the spy with calls.count(), will return the number of times the spy was called **/ 448 | count(): number; 449 | /** By chaining the spy with calls.argsFor(), will return the arguments passed to call number index **/ 450 | argsFor(index: number): any[]; 451 | /** By chaining the spy with calls.allArgs(), will return the arguments to all calls **/ 452 | allArgs(): any[]; 453 | /** By chaining the spy with calls.all(), will return the context (the this) and arguments passed all calls **/ 454 | all(): CallInfo[]; 455 | /** By chaining the spy with calls.mostRecent(), will return the context (the this) and arguments for the most recent call **/ 456 | mostRecent(): CallInfo; 457 | /** By chaining the spy with calls.first(), will return the context (the this) and arguments for the first call **/ 458 | first(): CallInfo; 459 | /** By chaining the spy with calls.reset(), will clears all tracking for a spy **/ 460 | reset(): void; 461 | } 462 | 463 | interface CallInfo { 464 | /** The context (the this) for the call */ 465 | object: any; 466 | /** All arguments passed to the call */ 467 | args: any[]; 468 | /** The return value of the call */ 469 | returnValue: any; 470 | } 471 | 472 | interface Util { 473 | inherit(childClass: Function, parentClass: Function): any; 474 | formatException(e: any): any; 475 | htmlEscape(str: string): string; 476 | argsToArray(args: any): any; 477 | extend(destination: any, source: any): any; 478 | } 479 | 480 | interface JsApiReporter extends Reporter { 481 | 482 | started: boolean; 483 | finished: boolean; 484 | result: any; 485 | messages: any; 486 | 487 | new (): any; 488 | 489 | suites(): Suite[]; 490 | summarize_(suiteOrSpec: SuiteOrSpec): any; 491 | results(): any; 492 | resultsForSpec(specId: any): any; 493 | log(str: any): any; 494 | resultsForSpecs(specIds: any): any; 495 | summarizeResult_(result: any): any; 496 | } 497 | 498 | interface Jasmine { 499 | Spec: Spec; 500 | clock: Clock; 501 | util: Util; 502 | } 503 | 504 | export var HtmlReporter: HtmlReporter; 505 | export var HtmlSpecFilter: HtmlSpecFilter; 506 | export var DEFAULT_TIMEOUT_INTERVAL: number; 507 | } 508 | -------------------------------------------------------------------------------- /src/AspNetCoreAngular2/web.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | --------------------------------------------------------------------------------