---
id: 2593
title: How to implement a BLINK tag in AngularJS
slug: how-to-implement-a-blink-tag-in-angularjs
date: '2012-05-31T03:23:37Z'
modified: '2012-05-31T06:02:05Z'
status: publish
type: post
author: pmoelgaard
categories:
  - CookBook
tags:
  - AngularJS
  - framework
  - HTML5
  - JavaScript
excerpt: null
canonicalPath: /posts/how-to-implement-a-blink-tag-in-angularjs
featuredImage: null
commentCount: 7
wordCount: 283
readingTimeMinutes: 2
hasMedia: false
hasVideos: false
url: >-
  https://forwardthinking.pemo.me/posts/how-to-implement-a-blink-tag-in-angularjs
---
One of the features of early HTML that is so uncool that it's so extremely cool now that it has taken epic proportions, is that much celebrated as well as hated BLINK tag... Now, it disappeared from most implementations due to the massive criticism it received, In 1996 [Jakob Nielsen](http://en.wikipedia.org/wiki/Jakob_Nielsen_\(usability_consultant\) "Jakob Nielsen (usability consultant)") even described the element as "simply evil" in his *Alertbox* column [*Top Ten Mistakes in Web Design*](http://www.useit.com/alertbox/9605a.html). Anyways, its back for the ones who think it could be a fun little thing to add anywhere, and now with AngularJS... let me just add, that I think it would be a horrible idea to put it in any website short of being a tribute website to horrible websites from the 80's...

```javascript

var blink = angular.module('blink', [])
    .directive('blink', function($timeout) {
    return {
        restrict: 'E',
        transclude: true,
        scope: {},
        controller: function($scope, $element) {
            function showElement() {
                $element.css(&quot;display&quot;, &quot;inline&quot;);
                $timeout(hideElement, 1000);
            }

            function hideElement() {
                $element.css(&quot;display&quot;, &quot;none&quot;);
                $timeout(showElement, 1000);
            }
            showElement();
        },
        template: '&lt;span ng-transclude&gt;&lt;/span&gt;',
        replace: true
    };
});​
```

Using it from HTML would be as simple as this...

```html

&lt;div ng-app=&quot;blink&quot;&gt;
    &lt;blink&gt;Forward Thinking&lt;/blink&gt;
&lt;/div&gt;​
```

You can check out the JSFiddle here... [http://jsfiddle.net/qy7Bt/59/](http://jsfiddle.net/qy7Bt/59/) The initial implementation was created by Søren Kyndi-Wiuff and it was then later refined to support a more mature version of AngularJS by Misko Hevery, both guys heavy-weight contributors to AngularJS... helped along the way by Mr. Ganaraj who was kind enough to point out and illustrate deprecated parts of the AngularJS... Check out AngularJS if you haven't done so yet and you are in the process of working on HTML systems, this is how HTML would have been if it had been created for Applications... [angularjs.org](http://angularjs.org)
