diff --git a/src/cdk/platform/platform.md b/src/cdk/platform/platform.md index 0ad007d9982d..5f033dca60c8 100644 --- a/src/cdk/platform/platform.md +++ b/src/cdk/platform/platform.md @@ -1,3 +1,6 @@ ### Platform -A service for determing the current platform. \ No newline at end of file +A set of utilities that gather information about the current +platform and the different features it supports. + + diff --git a/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.css b/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.css new file mode 100644 index 000000000000..7432308753e6 --- /dev/null +++ b/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.css @@ -0,0 +1 @@ +/** No CSS for this example */ diff --git a/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.html b/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.html new file mode 100644 index 000000000000..b130bd12ec02 --- /dev/null +++ b/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.html @@ -0,0 +1,11 @@ +
Is Android: {{platform.ANDROID}}
+Is iOS: {{platform.IOS}}
+Is Firefox: {{platform.FIREFOX}}
+Is Blink: {{platform.BLINK}}
+Is Webkit: {{platform.WEBKIT}}
+Is Trident: {{platform.TRIDENT}}
+Is Edge: {{platform.EDGE}}
+Supported input types: {{supportedInputTypes}}
+Supports passive event listeners: {{supportsPassiveEventListeners}}
+Supports scroll behavior: {{supportsScrollBehavior}}
diff --git a/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.ts b/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.ts new file mode 100644 index 000000000000..41fd1998e1e1 --- /dev/null +++ b/src/material-examples/cdk-platform-overview/cdk-platform-overview-example.ts @@ -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) {} +}