Skip to content

Latest commit

 

History

History
86 lines (57 loc) · 1.29 KB

README.md

File metadata and controls

86 lines (57 loc) · 1.29 KB

angularjs-placeholder

Implement a html5 placeholder feature to fix older browsers such as IE7 and IE8IE9 on angularjs. Don't need to include jQuery.

LiveDemo

demo

##I nstall

bower install angularjs-placeholder

Install node modules

npm install

Dependency

  • angularjs

Usage

Include the 'angulerjs-placeholder' module.

<script type="text/javascript" src="../src/angularjs-placeholder.js"></script>

Set a module dependency and initialize a ng-app.

<script type="text/javascript">
  var app = angular.module( "demoApp", ["html5.placeholder"] );
  angular.bootstrap( document, [app.name] );
</script>
submit a form:

IE7~IE9 need to clear values.

app.controller( "demoController", function( $element, placeholder ){

  placeholder.ensure( $element, function( record ){

    //doSomething

    //do rollback placeholder to element.
    if ( !valid ) record.back();
  })

});

Demo

Clone this project.

git clone [email protected]:SparrowJang/angularjs-placeholder.git

cd angularjs-placeholder

Install gulp dependencies

npm install

Run a static server.

gulp server

Build

Build a minify script.

gulp