add ng-placeholder directives

This commit is contained in:
MaysWind 2016-05-29 12:43:39 +08:00
parent 4fef60a671
commit 63e87b3f35
2 changed files with 19 additions and 1 deletions

View file

@ -109,7 +109,7 @@
<div class="navbar-searchbar hidden-xs">
<ul class="nav navbar-nav">
<li>
<input class="form-control" placeholder="{{('Search' | translate)}}" ng-model="searchContext.text" />
<input class="form-control" ng-placeholder="('Search' | translate)" ng-model="searchContext.text" />
<div class="form-control-icon">
<span class="fa fa-search form-control-feedback"></span>
</div>
@ -257,6 +257,7 @@
<script src="scripts/controllers/settings-ariang.js"></script>
<script src="scripts/controllers/status.js"></script>
<script src="scripts/controllers/task-detail.js"></script>
<script src="scripts/directives/placeholder.js"></script>
<script src="scripts/filters/dateDuration.js"></script>
<script src="scripts/filters/filename.js"></script>
<script src="scripts/filters/fileOrderBy.js"></script>

View file

@ -0,0 +1,17 @@
(function () {
'use strict';
angular.module("ariaNg").directive('ngPlaceholder', function () {
return {
restrict: 'A',
scope: {
placeholder: '=ngPlaceholder'
},
link: function (scope, elem, attr) {
scope.$watch('placeholder', function () {
elem[0].placeholder = scope.placeholder;
});
}
}
});
})();