Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/cdk/platform/platform.md
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
### Platform

A service for determing the current platform.
A set of utilities that gather information about the current
platform and the different features it supports.

<!-- example(cdk-platform-overview) -->
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
/** No CSS for this example */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
<h3>Platform information:</h3>
<p>Is Android: {{platform.ANDROID}}</p>
<p>Is iOS: {{platform.IOS}}</p>
<p>Is Firefox: {{platform.FIREFOX}}</p>
<p>Is Blink: {{platform.BLINK}}</p>
<p>Is Webkit: {{platform.WEBKIT}}</p>
<p>Is Trident: {{platform.TRIDENT}}</p>
<p>Is Edge: {{platform.EDGE}}</p>
<p>Supported input types: {{supportedInputTypes}}</p>
<p>Supports passive event listeners: {{supportsPassiveEventListeners}}</p>
<p>Supports scroll behavior: {{supportsScrollBehavior}}</p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
import {Component} from '@angular/core';
import {
getSupportedInputTypes,
Platform,
supportsPassiveEventListeners,
supportsScrollBehavior,
} from '@angular/cdk/platform';

/**
* @title Platform overview
*/
@Component({
selector: 'cdk-platform-overview-example',
templateUrl: 'cdk-platform-overview-example.html',
styleUrls: ['cdk-platform-overview-example.css'],
})
export class CdkPlatformOverviewExample {
supportedInputTypes = Array.from(getSupportedInputTypes()).join(', ');
supportsPassiveEventListeners = supportsPassiveEventListeners();
supportsScrollBehavior = supportsScrollBehavior();

constructor(public platform: Platform) {}
}