Skip to content

Instantly share code, notes, and snippets.

View ssukhpinder's full-sized avatar
🏠
Working from home

Sukhpinder Singh ssukhpinder

🏠
Working from home
View GitHub Profile
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class AuthGuardService {
constructor() {
}
npm install -g @angular/cli
ng new app-name
ng generate service servicename
//Generate new service using angular/cli with pathname
ng generate service my-test --path='src/app/home'
//Above command will generate mytestservice inside folder src > app > home
//Generate new service using angular/cli with flat option
ng generate service my-test --flat
//Above command will generate mytestservice inside folder src > app which is root folder
//Generate new service using angular/cli with skipTests option
ng generate service my-test --skipTests=true
//Above command will generate mytestservice inside folder src > app without .spec file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Angular Routes" stopProcessing="true">
<match url=".*" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
ng build --base-href='/basepath/'
ng generate component component-name