Monday 2 April 2018

Create Your First Angular 5 Project Step By Step


In this article, I will explain How to Create Project in Angular 5.

Step 1: Download nodeJs from https://nodejs.org/en/ and install it.

Step 2 : After installing nodeJs .Open cmd by run as administrator and type node -v for node version check as shown below :
Step 2: Type npm -v  for npm version check as shown below :
Step 3 : Install typescript using  "npm install typescript -g”.
The “-g” command says that you can execute typescript command from any folder.Typescript is a javascript open source framework so the best way to get it installed is by using “npm”.

Step 4 : Type tsc -v for typescript version check
Step 5 : Type npm install -g @angular/cli as shown below.The Angular CLI is a command line interface tool that can create a project, add files, and perform a variety of ongoing development tasks such as testing, bundling, and deployment
Step 6 : Type ng -v for checking Angular  CLI version

Step 7 : Go to location where you want to create project .Here i have  i want to create project inside DIT folder of my E drive  so Type ng new AngularDemo(Project Name) and hit enter as shown in below :It will some time...
Step 8 : After that Type cd AngularDemo(Porject name)
as shown below :
Step 9: Type ng serve --open as shown below :
Step 10 : Output is as shown in below and this is our first angular  app

Step 11 : Press ctrl+c and type y and enter as shown below :
Step 12 : Download and install visual studio code from https://code.visualstudio.com/download for editor.We can do angular in simple notepad but here we use visual studio code which helps us with all automation for HTML, JavaScript, Typescript and so on.
Step 13 :  After installation of visual studio code .go to cmd and open as administrator and type code .(dot)  .It will open your angular project in visual code editor.
Angular project in visual studio code 
Step 13: Now go to src->app->app.component.ts and change  title to "Hello Angular". as shown below 

Step 14 : Now go to src->app->app.component.html and change <P>{{title}}</P>
as Shown below

Step 15 : Now again go to cmd and open run as administrator and type ng serve --open  again
Step 16 : Now new output is as shown below and our angular app run on 4200 port but we can change this port.

Tuesday 25 July 2017

IONIC 3, ANGULAR 4 AND GOOGLE MAPS DIRECTIONS SERVICE


After play around with new Ionic 3 and Angular 4 in the previous tutorial, now we started the step by step tutorial of Ionic 3, Angular 4 and Google Maps Directions Service using Google Maps Javascript API.

1. Create New Ionic 3 and Angular 4 App

As usually, we are starting our tutorial from scratch. We assume that your computer or environment already have Node.js installed. Now, open the terminal or Node.js command line then type this command to install new Ionic 3 and Cordova.
sudo npm install -g cordova ionic
Now, go to project folders then type this command to make a new Ionic 3 App.
ionic start ionic3-googlemaps-directions blank --v2
Go to the newly created app folder.
cd ionic3-googlemaps-directions
This time we will modify few default files to implements lazy loading pages. Open and edit 'src/app/app.module.ts' then remove imports, NgModule-declaration and NgModule-entryComponents of page Home. So, this file will looks like this.
import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';

import { MyApp } from './app.component';

@NgModule({
  declarations: [
    MyApp
  ],
  imports: [
    BrowserModule,
    IonicModule.forRoot(MyApp)
  ],
  bootstrap: [IonicApp],
  entryComponents: [
    MyApp
  ],
  providers: [
    StatusBar,
    SplashScreen,
    {provide: ErrorHandler, useClass: IonicErrorHandler}
  ]
})
export class AppModule {}
Add new file 'src/pages/home/home.module.ts'.
touch src/pages/home/home.module.ts
Open and edit that file then add this lines of codes.
import { NgModule } from '@angular/core';
import { HomePage} from './home';
import { IonicPageModule } from 'ionic-angular';

@NgModule({
  declarations: [HomePage],
  imports: [IonicPageModule.forChild(HomePage)],
  entryComponents: [HomePage]
})
export class HomePageModule { }
Now, open and edit 'src/pages/home/home.ts' then add this import.
import { IonicPage } from 'ionic-angular';
Then add annotation of IonicPage before component annotation.
@IonicPage()
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
Next, open and edit 'src/app/app.component.ts' then remove import of HomePage and change reference to HomePage component to be 'HomePage' string.
import { Component } from '@angular/core';
import { Platform } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';

@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage: string = 'HomePage';

  constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen) {
    platform.ready().then(() => {
      // Okay, so the platform is ready and our plugins are available.
      // Here you can do any higher level native things you might need.
      statusBar.styleDefault();
      splashScreen.hide();
    });
  }
}
Now, run the app.
ionic serve -l
You should see this page in the browser.
Step by Step Tutorial of Ionic 3, Angular 4 and Google Maps Directions Service - Ionic 3 Home Page

2. Setup Google Maps and Google Maps Directions Service on Google Developer Console
Before setup Google Maps and Directions Service in the Ionic 3 and Angular 4 app, we have to make sure that Google Maps Javascript API and Google Maps Directions Service is enabled on Google Developer console.
Open your browser then go to Google Developer Console then click Enable API to enable Google Maps Javascript API and Google Maps Directions.
Step by Step Tutorial of Ionic 3, Angular 4 and Google Maps Directions Service - Google Developer Console
After enabling Google Maps and Google Maps Directions then Go to Credentials page by click on Credentials left the menu. Make sure that you have Browser Key, if not create Browser key by click on Create Credentials button.
Step by Step Tutorial of Ionic 3, Angular 4 and Google Maps Directions Service - Create Credentials
Write down the key on a notepad or any text editor, because we will use it later on the app.

3. Implement Google Maps and Google Maps Directions Service on The Ionic 3 App
Now, it's time to implement Google Maps and Google Maps Directions Service on the Ionic 3 app. Starting with reference Javascript library of Google Maps in 'src/index.html'. Open and edit 'src/index.html' then add this script reference before the closing of the body tag.
<script src="https://maps.googleapis.com/maps/api/js?key=YOUR_API_KEY"></script>
Change 'YOUR_API_KEY' with the key that previously written in the text editor.
Next, open and edit 'src/pages/home/home.html' then replace all tags inside 'ion-content' with this lines of tags.
<ion-content>
  <div id="floating-panel">
    <b>Start: </b>
    <select [(ngModel)]="start" id="start" (change)="calculateAndDisplayRoute()">
      <option value="chicago, il">Chicago</option>
      <option value="st louis, mo">St Louis</option>
      <option value="joplin, mo">Joplin, MO</option>
      <option value="oklahoma city, ok">Oklahoma City</option>
      <option value="amarillo, tx">Amarillo</option>
      <option value="gallup, nm">Gallup, NM</option>
      <option value="flagstaff, az">Flagstaff, AZ</option>
      <option value="winona, az">Winona</option>
      <option value="kingman, az">Kingman</option>
      <option value="barstow, ca">Barstow</option>
      <option value="san bernardino, ca">San Bernardino</option>
      <option value="los angeles, ca">Los Angeles</option>
    </select><br>
    <b>End: </b>
    <select [(ngModel)]="end" id="end" (change)="calculateAndDisplayRoute()">
      <option value="chicago, il">Chicago</option>
      <option value="st louis, mo">St Louis</option>
      <option value="joplin, mo">Joplin, MO</option>
      <option value="oklahoma city, ok">Oklahoma City</option>
      <option value="amarillo, tx">Amarillo</option>
      <option value="gallup, nm">Gallup, NM</option>
      <option value="flagstaff, az">Flagstaff, AZ</option>
      <option value="winona, az">Winona</option>
      <option value="kingman, az">Kingman</option>
      <option value="barstow, ca">Barstow</option>
      <option value="san bernardino, ca">San Bernardino</option>
      <option value="los angeles, ca">Los Angeles</option>
    </select>
    </div>
    <div #map id="map"></div>
</ion-content>
The most important thing when using Google Maps in HTML is specifying the height of the map element 'DIV', otherwise the maps will never shown. For that, open and edit 'src/pages/home/home.scss' then make it like this.
page-home {
  #floating-panel {
    position: absolute;
    top: 10px;
    right: 5px;
    z-index: 5;
    background-color: #fff;
    padding: 5px;
    border: 1px solid #999;
    text-align: center;
    font-family: 'Roboto','sans-serif';
    line-height: 30px;
    padding-left: 10px;
  }
  #map {
    height: 100%;
  }
}
Open and edit 'src/pages/home/home.ts' then replace all codes with this codes.
import { Component, ViewChild, ElementRef } from '@angular/core';
import { IonicPage } from 'ionic-angular';
import { NavController } from 'ionic-angular';

declare var google;

@IonicPage()
@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  @ViewChild('map') mapElement: ElementRef;
  map: any;
  start = 'chicago, il';
  end = 'chicago, il';
  directionsService = new google.maps.DirectionsService;
  directionsDisplay = new google.maps.DirectionsRenderer;

  constructor(public navCtrl: NavController) {

  }

  ionViewDidLoad(){
    this.initMap();
  }

  initMap() {
    this.map = new google.maps.Map(this.mapElement.nativeElement, {
      zoom: 7,
      center: {lat: 41.85, lng: -87.65}
    });

    this.directionsDisplay.setMap(this.map);
  }

  calculateAndDisplayRoute() {
    this.directionsService.route({
      origin: this.start,
      destination: this.end,
      travelMode: 'DRIVING'
    }, (response, status) => {
      if (status === 'OK') {
        this.directionsDisplay.setDirections(response);
      } else {
        window.alert('Directions request failed due to ' + status);
      }
    });
  }

}
4. Run Ionic 3 App on The Browser and Device
To run the Ionic 3 app on the browser, type this command.
ionic serve -l
You should see this page.
Step by Step Tutorial of Ionic 3, Angular 4 and Google Maps Directions Service - Google Maps
When you change to start, end or both select box, the map should show directions like this.
Step by Step Tutorial of Ionic 3, Angular 4 and Google Maps Directions Service - Directions
To run the Ionic 3 app on the device, don't forget to re-add platforms.
ionic platform rm ios
ionic platform add ios
ionic platform rm android
ionic platform add android
Finally, run the Ionic 3 app on the device.
ionic run android
or
ionic run ios
If you see same as the browser, then everything is working properly.

Thanks!

Saturday 22 July 2017

IONIC 3 AND ANGULAR 4 MULTI LEVEL ACCORDION MENU EXAMPLE

This is an example of a multi-level accordion menu with dynamic data using latest Ionic 3 and Angular 4.

1. Create New Ionic 3 and Angular 4 Side Menu App

We will start this tutorial by creating new Ionic 3 and Angular 4 app. This time we will use generated side menu app. Open and edit the terminal or Node.js command line then type this command.
ionic start ionic3-accordion-menu sidemenu --v2
That command will create new Ionic 3 app with the name 'ionic3-accordion-menu' using default template 'sidemenu'. Go to the newly created app folder.
cd ionic3-accordion-menu
Run the Ionic 3 app on the browser.
ionic serve -l
You should see this side menu.
Ionic 3 and Angular 4 Multi Level Accordion Menu Example - Side Menu
Right now, we will skip lazy loading pages configuration because we will focus only on the multilevel accordion menu. You can find more about lazy loading and Ionic 3 getting started here.


2. Create Nested Array of Objects

We have to create nested Array of objects which it's contains multilevel arrays. Create a new folder and JSON file in asset folder.
mkdir src/assets/data
touch src/assets/data/menus.json
Open and edit 'menus.json' then add this lines of data.
[
  {
    "category":"PC",
    "subs": [
      {
        "subcategory":"Processor",
        "manufactures": [
          {
            "manufacture":"Intel"
          },
          {
            "manufacture":"AMD"
          }
        ]
      },
      {
        "subcategory":"Motherboard",
        "manufactures": [
          {
            "manufacture":"Asus"
          },
          {
            "manufacture":"AMD"
          },
          {
            "manufacture":"GigaByte"
          },
          {
            "manufacture":"Intel"
          }
        ]
      },
      {
        "subcategory":"Memory",
        "manufactures": [
          {
            "manufacture":"Visipro"
          },
          {
            "manufacture":"Crucial"
          },
          {
            "manufacture":"VenomRX"
          }
        ]
      }
    ]
  },
  {
    "category":"Laptop",
    "subs": [
      {
        "subcategory":"Notebook",
        "manufactures": [
          {
            "manufacture":"Lenovo"
          },
          {
            "manufacture":"Dell"
          }
        ]
      },
      {
        "subcategory":"Netbook",
        "manufactures": [
          {
            "manufacture":"Lenovo"
          },
          {
            "manufacture":"Dell"
          },
          {
            "manufacture":"Acer"
          },
          {
            "manufacture":"HP"
          }
        ]
      }
    ]
  },
  {
    "category":"Printer",
    "subs": [
      {
        "subcategory":"Laserjet",
        "manufactures": [
          {
            "manufacture":"HP"
          },
          {
            "manufacture":"Brother"
          },
          {
            "manufacture":"Canon"
          },
          {
            "manufacture":"Samsung"
          }
        ]
      },
      {
        "subcategory":"Deskjet",
        "manufactures": [
          {
            "manufacture":"HP"
          },
          {
            "manufacture":"Canon"
          },
          {
            "manufacture":"Epson"
          }
        ]
      }
    ]
  }
]

3. Create and Call Service/Provider for Accessing Data
To access JSON data we have to create new service or provider to keep app modular. Type this command to create it.
ionic g provider DataService
Open and edit 'src/providers/data-service.ts' add 'Response' to 'Http' import.
import { Http, Response } from "@angular/http";
Create this function for call JSON data.
getMenus(){
  return this.http.get('assets/data/menus.json')
   .map((response:Response)=>response.json());
}
Register this service in 'app.module.ts' by open and edit 'src/app/app.module.ts' then add this import.
import { HttpModule } from '@angular/http';
import { DataService } from '../providers/data-service';
Add 'HttpModule' in '@NgModule' imports.
...
imports: [
  BrowserModule,
  IonicModule.forRoot(MyApp),
],
...
Add 'DataService' in '@NgModule' providers.
...
providers: [
  StatusBar,
  SplashScreen,
  {provide: ErrorHandler, useClass: IonicErrorHandler},
  DataService
]
...
Because menu holds by component, we have to edit it to call data for the menu from service/provider. Open and edit 'src/app/app.component.ts' then add this import.
import { DataService } from '../providers/data-service';
Replace this line.
pages: Array<{title: string, component: any}>;
With this.
pages: any;
Now, inject 'DataService' in constructor parameter and add this function for calling JSON data inside of constructor.
constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen, public dataService: DataService) {
  this.initializeApp();

  this.dataService.getMenus()
    .subscribe((response)=> {
        this.pages = response;
        console.log(this.pages);
    });

}


4. Create Multilevel Accordion Menu

Now, is the point. Creating multilevel Accordion Menu with Ionic 3 and Angular 4. Open and edit 'src/app/app.html' the add this lines of codes inside '<ion-content>'.
<ion-content>
  <ion-list>
    <ion-item *ngFor="let p of pages" text-wrap>
      {{p.category}}
      <ion-list>
        <ion-item *ngFor="let s of p.subs" text-wrap>
          {{s.subcategory}}
          <ion-list>
            <ion-item *ngFor="let m of s.manufactures" text-wrap>
              {{m.manufacture}}
            </ion-item>
          </ion-list>
        </ion-item>
      </ion-list>
    </ion-item>
  </ion-list>
</ion-content>
After we re-run the Ionic 3 app, the menu should look like this.
Ionic 3 and Angular 4 Multi Level Accordion Menu Example - Multi Level Menu
As you can see, there is 3 level of the menu. For that, we have to make accordion to hide child menus. Open and edit 'src/app/app.component.ts' then declare this variable.
showLevel1 = null;
showLevel2 = null;
Create new functions for toggle show/hide level 2 and level 3 of the menu.
toggleLevel1(idx) {
  if (this.isLevel1Shown(idx)) {
    this.showLevel1 = null;
  } else {
    this.showLevel1 = idx;
  }
};

toggleLevel2(idx) {
  if (this.isLevel2Shown(idx)) {
    this.showLevel1 = null;
    this.showLevel2 = null;
  } else {
    this.showLevel1 = idx;
    this.showLevel2 = idx;
  }
};
Also, create the function for check if level 2 and 3 is shown or hidden.
isLevel1Shown(idx) {
  return this.showLevel1 === idx;
};

isLevel2Shown(idx) {
  return this.showLevel2 === idx;
};
Now, open and edit 'src/app/app.html' then replace all list with this list.
<ion-content>
  <ion-list>
    <ion-item *ngFor="let p of pages; let i=index" text-wrap (click)="toggleLevel1('idx'+i)" [ngClass]="{active: isLevel1Shown('idx'+i)}">
      <h4>
        {{p.category}}
        <ion-icon color="success" item-right [name]="isLevel1Shown('idx'+i) ? 'arrow-dropdown' : 'arrow-dropright'"></ion-icon>
      </h4>
      <ion-list *ngIf="isLevel1Shown('idx'+i)">
        <ion-item *ngFor="let s of p.subs; let i2=index" text-wrap (click)="toggleLevel2('idx'+i+'idx'+i2)" [ngClass]="{active: isLevel2Shown('idx'+i+'idx'+i2)}">
          <h4>
            {{s.subcategory}}
            <ion-icon color="success" item-right [name]="isLevel2Shown('idx'+i+'idx'+i2) ? 'arrow-dropdown' : 'arrow-dropright'"></ion-icon>
          </h4>
          <ion-list *ngIf="isLevel2Shown('idx'+i+'idx'+i2)">
            <ion-item *ngFor="let m of s.manufactures" text-wrap>
              {{m.manufacture}}
            </ion-item>
          </ion-list>
        </ion-item>
      </ion-list>
    </ion-item>
  </ion-list>
</ion-content>
Then re-run the Ionic 3 app and see the results in the browser.
Ionic 3 and Angular 4 Multi Level Accordion Menu Example - Multi Level Accordion Menu
That it's for now, we are leaving this tutorial without action for click on each menu item. We know this isn't a best and simple way for creating multiple accordions. For that, we need suggestions and best algorithm to make this tutorial better and useful for everyone.

Tuesday 18 July 2017

Angular 4 PHP + MySQL Shared Hosting

                               


                                 How to use Angular and Php on a shared server.


Start

We will look at a simple example of how to apply with Angular and pure Php on a shared server just for ideas.You can check the DEMO for the latest version .


Used technologies


  • Php 5.x
  • MySQL
  • Angular 4 (cli)

Step 1:

First, create a database called "cities" with mysql and a table called "city" in it and add the data for the test.


Res 1.1 (a) Mysql data structure (b) Table


Step 2:

Now let's write a php script that connects to the database and pulls the data.

veritabani.php 

<?php
header("Content-Type: application/json; charset=utf-8");

$conn = new mysqli("localhost", "root", "", "city");
$conn->set_charset("UTF8");
?>
  • We can declare a Content-Type json and return to the client a json.
  • Set the rest according to yourself. When assigning to the host, you will have to enter the host settings.
Let's create cities.php file and include the above database file. 

<?php
require_once  'veritabani.php'; //$conn

$result = $conn->query("SELECT * FROM cities");

$outp = "";
while($rs = $result->fetch_array(MYSQLI_ASSOC)) {
    if ($outp != "") {$outp .= ",";}
    $outp .= '{"ID":"'  . $rs["ID"] . '",';
    $outp .= '"name":"'   . $rs["name"]        . '",';
    $outp .= '"country":"'. $rs["country"]     . '"}'; 
}
$outp ='{"records":['.$outp.']}';
$conn->close();
echo($outp);
?>
  • We convert the data from the cities table above into a Json structure and press "echo".
  • If we go to http: //localhost/php-angular-backend/model/cities.php we will see json data like this :
  • So we finished the server by writing simple end-point.

{"records":[{"ID":"1","name":"İstanbul","country":"Turkey"},{"ID":"2","name":"Ankara","country":"Turkey"}]}

Step 3:

Now we go to the client side. Create an infrastructure using angular cli.

  • If Node.js and angular-cli are not installed, you can install NodeJs and angular-cli respectively .
  • We will take advantage of the blessings of these technologies, and we will simply drop the last code on the host.
Once you have done the installations, open any command interpreter (CMD, Terminal, etc.) and enter the following commands in order to create an angular project. 
Note: Run CMD as an administrator on Windows. 

ng new php-angular
cd php-angular
ng serve
Open the project in the code editor. Direct code in project directory in console if you are using Visual Studio Code You can write. 
Write the following code as a console to create our first service to talk to the php server.
ng g service cities

Step 4:

Let's add our service codes.


import { Observable } from 'rxjs/Rx';

import { City } from './city';
// Import RxJs required methods
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import 'rxjs/Rx';

@Injectable()
export class CitiesService {
 
  private url = "http://localhost/php-angular-backend/model/cities.php";
  
  constructor(private _http:Http) { }

  getCities(): Observable<City[]>{
      // url:api/users
      // get all Users
       return this._http.get(this.url)
                .delay(2000) //end-point sahte bir gecikme verelim
                .do(console.log) //gerekli değil ama..
                .map((res:Response)=>res.json().records)
                .do(console.log);
   }
}
  • We specify the URL to return json data. (Server address when assigning to server)
  • We inject (inject) the Http service to send the Get request.
  • We send our request in the getCities () method and use the Observable data service on the incoming stream, respectively:
    • We add a 2 second delay only for the test
    • We are pushing the incoming stream directly to the screen do (console.log)
    • We are converting the incoming Json string expression to a Json object expression. (Map)
    • We print the converted statement back to the console.
City.ts I create the City model class. The service will rotate the sequence of this model.

export class City {
    ID:number;
    name:string;
    country:string;
}

Step 5:

App.component.ts - Component to use the service


import { Component,OnInit,Input } from '@angular/core';
import { CitiesService } from './cities.service';
import { City } from './city';
import { Observable } from 'rxjs/Rx';
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit{
  title = 'City App';
  cities:City[];

  constructor(public _cityService:CitiesService){}

  ngOnInit(){
    this._cityService.getCities()
    .subscribe(
        cities => (this.cities = cities) 
    );
  }
}
  • We use the ngOnInit method which will be called after the Component is created.
  • Here we are subscribing to the getCities method of the service (Observer or Subscriber) so that we can see the return data from Observable. We are throwing the return versi cities array.

Step 6:

App.component.html - We are printing data on the screen.


<div *ngIf="cities as city; else loading" id="cities">
 <ul>
  <li *ngFor="let city of cities">
    <span class="idtext">{{city.ID}}</span> -- {{city.name}} -- {{city.country}}
  </li>
 </ul>
</div>
<ng-template  #loading>
  <div class="loading">
    <img src="assets/images/preloader.gif">
  </div>
</ng-template>
  • We use the if else structure that comes with Angular 4.
  • If you do not press the screen when cities are available, we show another picture with ng-template.
  • Ng-template 'with #loading (template variable).

Step 7:

Building client code


ng build --prod
  • In the Console we enter the above command to make the project ready for presentation.
  • This will do all the optimizations. (Compression, merge css, js, etc.)
  • The resulting files will be placed under dist / under the project folder. These files are in the php project folder.
  • Index.html and specify your php project root directory at <base href = "/ php-angular-backend /"> . If this is not important, the project will not work.

Res 7.1 Project Structure

Step 8:

Route URLs to index.html

Create a .htaccess file in the main directory of the php folder and enter the following commands.

DirectoryIndex index.html

<IfModule mod_rewrite.c>
    Options -Indexes +FollowSymlinks
    RewriteEngine On

    
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
    RewriteRule ^ - [L]
   
    RewriteCond %{REQUEST_URI} ^.*/$
    RewriteCond %{REQUEST_URI} !^/$
    RewriteRule ^(.*)/$ $1 [R,QSA,L]
    
    RewriteRule ^ index.html [L]
 
</IfModule>
  • The incoming requests will be collected in index.html.
  • The above commands are sufficient if you do not perform the router operation but assume that we will.

Note (Seo) : Google can directly index Angular pages. But the bottom pages can get in trouble. For now, you need to add each sub-page via Fetch as Google. Facebook Comment Api is not a problem to use, but Facebook Share is difficult to share dynamic content. In such cases, server rendering is required.
You can look at the demo of the application .