npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@iamadamjowett/angular-check-ie

v1.2.1

Published

An AngularJS directive that checks against a minimum Internet Explorer version before including content.

Downloads

4

Readme

Checkie for AngularJS

An AngularJS directive that checks against a minimum Internet Explorer version before including content.

What does Checkie do?

Checkie is a simple directive to do a check to see if the browser is:

  1. Internet Explorer
  2. The Internet Explorer version is less than 9 (default) or the user specified version via the checkie-min-ie attribute

This directive can wrap any content you may wish to not include for old browsers, from navigation elements, to your ng-view (See Usage below).

<div data-checkie data-checkie-min-ie="9" data-checkie-message="You are using a dodgy browser, please update.">
    <div data-ng-view="myApp"></div>
</div>

Installation

There are two easy ways to install the checkie directive:

Node

To install via npm, run:

npm install @iamadamjowett/angular-check-ie

Bower

To install via Bower, run:

bower install angular-check-ie 

Manual download

Download the checkie.directive.js folder, and include it in your index.html file with something like:

<script type="text/javascript" src="/path/to/checkie.directive.js"></script>

Also be sure to include the module in your app.js file with:

angular.module('yourAppName', ['angular-checkie'])

Usage

To use the checkie directive, wrap some content in either a <checkie> tag, or via attribute for older browsers. This will check and not include the wrapped content if the browser is a version of Internet Explorer less than 9 (the default check value). e.g.

<checkie>
    <div>This is content only for modern browsers.</div>
</checkie>

or

<div checkie>
    <div>This is content only for modern browsers.</div>
</div>

or even

<div data-checkie>
    <div>This is content only for modern browsers.</div>
</div>

By default, the above will hide the content and leave a message of "You're using Internet Explorer [the ie version], please update your browser.". This is great for full page hides, but not great if hiding small elements, so you can override this with the checkie-message attribute (see Custom checkie message).

To hide your entire apps view from old browsers:

<checkie>
    <div ng-view="myApp"></div>
</checkie>

Custom Internet Explorer version checkdate

By default, checkie will look for Internet Explorer 8 and below, but if you want to change that, you can do that via the checkie-ie-min attribute:

<checkie checkie-ie-min="9">
    <div ng-view="myApp"></div>
</checkie>

or

<div data-checkie data-checkie-min-ie="9">
    <div ng-view="myApp"></div>
</div>

Custom checkie message

You may want to display a message to the user of the old browser, this can be done via the checkie-message attribute:

<checkie checkie-message="Please update your browser you poor sod">
    <div ng-view="myApp"></div>
</checkie>

or

<div data-checkie data-checkie-message="You are using a dodgy browser, please update.">
    <div ng-view="myApp"></div>
</div>

Debugging

Checkie comes with a debug tag to test the functionality and visibility of elements. To simulate an Internet Explorer version add the checkie-debug tag and give a version to check:

<checkie checkie-debug="6">
    <div ng-view="myApp"></div>
</checkie>

or

<div data-checkie data-checkie-debug="6">
    <div ng-view="myApp"></div>
</div>

The above pretends the browser is Internet Explorer 6 and processes it accordingly.

Display

The checkie directive will wrap your content in a div with the classes:

- checkie
- outdated - this is only shown if the Internet Explorer version check find it is an old version

This should allow you to style the checkie directive as you need on older browsers.

Credits

This directive spawned from @padolsey's gist and it's associated discussion: https://gist.github.com/padolsey/527683

Licence

MIT, free to use in personal and commercial projects.