Skip to content
This repository has been archived by the owner on Sep 23, 2024. It is now read-only.

bezuglov/user-environment-angular.dart

 
 

Repository files navigation

travis build

User Environment

This package allows to detect the platform and the browser version used to view a web page.

Differentiated browsers are: IE, Edge, Chrome, Safari, Gecko, Opera, Electron, Other along with Mac, Windows and Other platforms.

Usage

import 'package:angular2/angular2.dart';
import 'package:user_environment_angular/user_environment.dart';

@Directive(
  selector: 'my-directive',
  providers: const [
  USER_ENVIRONMENT_PROVIDERS
  ]
)
class MyDirective {

  MyDirective(UserEnvironment env) {
  if (env.platform.type == UserPlatformType.Mac &&
    env.browser.type == BrowserType.Chrome &&
    env.browser.productVersion('AppleWebkit') == new BrowserVersion('1.2.3')) {
      // Do something
    }
  }
}

About

User environment detection for AngularDart

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 100.0%