Skip to content

Instantly share code, notes, and snippets.

View cyrilletuzi's full-sized avatar

Cyrille Tuzi cyrilletuzi

View GitHub Profile
/* jQuery */
someElement.text();
someElement.text(`New content`);
someElement.html();
someElement.html(`New content`);
/* JavaScript */
someElement.textContent;
someElement.textContent = `New content`;
app/
|- app.module.ts
|- app-routing.module.ts
|- core/
|- auth/
|- auth.module.ts (optional since Angular 6)
|- auth.service.ts
|- index.ts
|- othermoduleofglobalservice/
|- ui/
describe('Account', () => {
it('should register successfully', () => {
const email = `test_${Date.now()}@example.com`;
const password = 'test';
cy.visit('/account/register');
cy.get('input[type="email"]').type(email);
import { browser, $, ExpectedConditions } from 'protractor';
describe('Account', () => {
it('should register successfully', async () => {
const email = `test_${Date.now()}@example.com`;
const password = 'test';
await browser.get('/account/register');
{
"root": true,
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:cypress/recommended"
]
}
{
"root": true,
"ignorePatterns": [
"projects/**/*"
],
"overrides": [
{
"files": [
"*.ts"
],
{
"angular.experimental-ivy": true
}
{
"angularCompilerOptions": {
"strictInjectionParameters": true,
"strictTemplates": true,
"strictInputAccessModifiers": true
}
}
import { Injectable, Inject, Optional } from '@angular/core';
import { HttpInterceptor, HttpHandler, HttpRequest } from '@angular/common/http';
@Injectable()
export class UniversalInterceptor implements HttpInterceptor {
constructor(@Optional() @Inject('serverUrl') protected serverUrl: string) {}
intercept(req: HttpRequest<any>, next: HttpHandler) {
<div *ngFor="let movie of movies">
<h2>{{movie.title}}</h2>
<p>{{movie.description}}</p>
</div>