This file contains 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
// ES 7 | |
var fruits = ['mango', 'jack fruit', 'banana' ] | |
fruits.includes('mango') // true | |
fruits.includes('orange') // false | |
// Earlier |
This file contains 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
// Math.pow (x, y) | |
Math.pow(2,3) // 8 | |
2 ** 3 | |
// 8 | |
// where first digit is base and second digit is exponent | |
var square = 5 ** 2; | |
console.log(square) // 25 |
This file contains 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 Event | |
{ | |
public int Id { get; set; } | |
public string Organiser { get; set; } | |
public DateTime EventDate { get; set; } | |
} |
This file contains 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
namespace APITest.Controllers | |
{ | |
[Route("api/[controller]")] | |
[ApiController] | |
public class EventsController : ControllerBase | |
{ | |
private readonly EventContext _context; | |
public EventsController(EventContext context) | |
{ |
This file contains 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
{ | |
"$schema": "http://json.schemastore.org/launchsettings.json", | |
"iisSettings": { | |
"windowsAuthentication": false, | |
"anonymousAuthentication": true, | |
"iisExpress": { | |
"applicationUrl": "http://localhost:32022", | |
"sslPort": 44384 | |
} | |
}, |
This file contains 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
using Microsoft.AspNetCore.Mvc.ApiExplorer; | |
namespace Microsoft.AspNetCore.Mvc | |
{ | |
public static class DefaultApiConventions | |
{ | |
[ApiConventionNameMatch(ApiConventionNameMatchBehavior.Prefix)] | |
[ProducesDefaultResponseType] | |
[ProducesResponseType(201)] | |
[ProducesResponseType(400)] |
This file contains 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
{ | |
"$schema": "./node_modules/@angular/cli/lib/config/schema.json", | |
"version": 1, | |
"newProjectRoot": "projects", | |
"projects": { | |
"angular-localize": { | |
"projectType": "application", | |
"i18n": { | |
"locales": { |
This file contains 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
<?xml version="1.0" encoding="UTF-8" ?> | |
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | |
<file source-language="en-US" datatype="plaintext" original="ng2.template"> | |
<body> | |
<trans-unit id="8298328021206315701"> | |
<source>angular-localize</source> | |
<target>Bonjour</target> | |
</trans-unit> | |
</body> | |
</file> |
This file contains 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
<?xml version="1.0" encoding="UTF-8" ?> | |
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2"> | |
<file source-language="en-US" datatype="plaintext" original="ng2.template"> | |
<body> | |
<trans-unit id="3902961887793684628"> | |
<source>hello</source> | |
<target>வணக்கம்</target> | |
</trans-unit> | |
</body> | |
</file> |
This file contains 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
@Injectable({ | |
providedIn: 'root' | |
}) | |
export class CustomPreload implements PreloadingStrategy { | |
preload(route: Route, load: (): Observable<any>): Observable<any> { | |
// you implement this function somewhere, somehow | |
if (isActiveCardRoute(route)) { | |
// this will make it load immediately | |
return load(); | |
} else { |