This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div [@enterAnimation] (@enterAnimation.done)="animationEndCallback($event)"> | |
</div> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Version } from '../package.json'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadChildren : () => import('./lazy/lazy.module').then(m => m.LazyModule), // new dynamic import method | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
loadChildren: './lazy/lazy.module#LazyModule', // use this syntax for non-ivy or Angular 7 and below | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const webpack = require("webpack"); | |
module.exports = { | |
outputDir: '../wwwroot/dist', | |
publicPath: "/dist/", | |
filenameHashing: false, | |
configureWebpack: { | |
plugins: [ | |
new webpack.ProvidePlugin({ | |
$: 'jquery', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builder.UseMvc(routes => | |
{ | |
routes.MapRoute("apiDefault", "api/{*url}", new { controller = "Home", action = "ApiNotFound" }); | |
routes.MapRoute("spa-routes", "{*anything}", new { controller = "Home", action = "Index" }); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class JsonStatusCodeMiddleWare | |
{ | |
private readonly RequestDelegate _next; | |
public JsonStatusCodeMiddleWare(RequestDelegate next) | |
{ | |
_next = next; | |
} | |
public async Task Invoke(HttpContext context) | |
{ | |
if (context.Response.StatusCode == (int)HttpStatusCode.OK) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services.AddSwaggerGen(c => | |
{ | |
c.SwaggerDoc("v1", new OpenApiInfo { Title = "Mediris Recipe API", Version = "v1" }); | |
c.AddSecurityDefinition("Bearer", new OpenApiSecurityScheme | |
{ | |
Description = "JWT Authorization header using the Bearer scheme. \r\n\r\n Enter 'Bearer' [space] and then your token in the text input below.\r\n\r\nExample: \"Bearer 12345abcdef\"", | |
Name = "Authorization", | |
In = ParameterLocation.Header, | |
Type = SecuritySchemeType.ApiKey, | |
Scheme = "Bearer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public abstract class BaseTest | |
{ | |
public static ServiceProvider serviceProvider; | |
public IMyService _myService; | |
[AssemblyInitialize] | |
public static void SetUp(TestContext context) | |
{ | |
IServiceCollection services = new ServiceCollection(); | |
services.AddTransient<IMyService, MyService>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestClass] | |
public class MyServiceTests : BaseTest | |
{ | |
[TestMethod] | |
public void TestMethod() | |
{ | |
var result = _myService.myMethod() | |
Assert.IsNotNull(result); | |
} | |
} |