From 9b5b63dfbf7c12b555bf1b7e07719b61cb936de1 Mon Sep 17 00:00:00 2001 From: Hypercubed Date: Thu, 21 Nov 2013 15:04:24 +0900 Subject: [PATCH] Now observe changes in placeholder --- example/index.html | 6 +++--- lib/angular-floating-label.js | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/example/index.html b/example/index.html index 9c72146..50802e0 100644 --- a/example/index.html +++ b/example/index.html @@ -38,9 +38,9 @@
-

-

-

+

+

+

diff --git a/lib/angular-floating-label.js b/lib/angular-floating-label.js index cb67c8d..992488d 100644 --- a/lib/angular-floating-label.js +++ b/lib/angular-floating-label.js @@ -9,6 +9,13 @@ link: function(scope, el, args) { var options = scope.options(); el.floatingLabel(options); + + var label = $('label[for="' + el.attr('id') + '"]'); + + args.$observe('placeholder', function(value) { + label.text(value); + }); + } }; }]);