Angular10 isPlatformBrowser() Function Last Updated : 06 Jan, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report In this article, we are going to see what is isPlatformBrowser in Angular 10 and how to use it. The isPlatformBrowser is used to get a platform id that represents a browser platform Syntax: isPlatformBrowser(platformId); NgModule: Module used by isPlatformBrowser is: CommonModule Return Value: returns a Boolean Value stating whether a platform id represents a browser platform. Approach: Create the angular app to be usedImport isPlatformBrowser from @angular/core to the project.In app.component.ts define the object which holds the Boolean value.serve the angular app using ng serve to see the output Example 1: app.component.ts import { Component, Inject } from '@angular/core'; import { PLATFORM_ID } from '@angular/core'; import { isPlatformBrowser } from '@angular/common'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: [ './app.component.css' ] }) export class AppComponent { isBrowser: boolean; constructor( @Inject(PLATFORM_ID) platformId: Object) { this.isBrowser = isPlatformBrowser(platformId); console.log(this.isBrowser) } } Output: Example 2: app.component.ts import { Component, Inject } from '@angular/core'; import { PLATFORM_ID } from '@angular/core'; import { isPlatformBrowser } from '@angular/common'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: [ './app.component.css' ] }) export class AppComponent { isB: boolean; constructor( @Inject(PLATFORM_ID) platformId: Object) { this.isB = isPlatformBrowser(platformId); } } app.component.html <div *ngIf='isB'><strong>GeeksforGeeks.</strong></div> <div *ngIf='isB'>isBrowserPlatform | angularJs.</div> Output: Reference: https://angular.io/api/common/isPlatformBrowser Comment More infoAdvertise with us Next Article Angular10 isPlatformBrowser() Function T taran910 Follow Improve Article Tags : Web Technologies AngularJS AngularJS-Function Angular10 Similar Reads Angular10 isPlatformServer() Function In this article, we are going to see what is isPlatformServer in Angular 10 and how to use it. The isPlatformServer is used to get a platform id that represents a server platform Syntax: isPlatformServer(platformId); NgModule: Module used by isPlatformServer is: CommonModule Return Value: returns a 2 min read Angular 10 isPlatformWorkerUi API In this article, we are going to see what is isPlatformWorkerUi in Angular 10 and how to use it. The isPlatformWorkerUi API is used to get a platform id that represents a web worker UI platform. Syntax: isPlatformWorkerUi( platformId ); NgModule: Module used by isPlatformWorkerUi is: CommonModule Re 2 min read Angular 10 isPlatformWorkerApp API In this article, we are going to see what is isPlatformWorkerApp in Angular 10 and how to use it. The isPlatformWorkerApp API is used to get a platform id that represents a worker app platform. Syntax: isPlatformWorkerApp( platformId ); NgModule: Module used by isPlatformWorkerApp is: CommonModule R 2 min read AngularJS angular.isElement() Function The angular.isElement() Function in AngularJS is used to determine if the parameter inside isElement function is a HTML DOM element or not. It returns true if the reference is a DOM element or else false. Syntax: angular.isElement(value)Parameter: value: It is used to validate whether the passed ar 2 min read Component Communication in Angular Angular, as a robust front-end framework, allows you to build complex and interactive web applications by creating reusable components. One of the key aspects of building such applications is effective communication between these components. There are a lot of instances where we need to transfer dat 12 min read Like