Skip to content

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

License

Notifications You must be signed in to change notification settings

SparrowJang/angularjs-placeholder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 git@github.com:SparrowJang/angularjs-placeholder.git

cd angularjs-placeholder

Install gulp dependencies

npm install

Run a static server.

gulp server

Build

Build a minify script.

gulp

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published