Skip to content

Commit a87055f

Browse files
committed
2.0.0
1 parent 089474e commit a87055f

File tree

4 files changed

+15
-21
lines changed

4 files changed

+15
-21
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-input-hints",
3-
"version": "1.0.0",
3+
"version": "2.0.0",
44
"authors": [
55
"William Boman <[email protected]>"
66
],

dist/angular-input-hints.js

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
angular-input-hints v1.0.0
33
https://github.com/williamboman/angular-input-hints
44
5-
Copyright (c) 2014 William Boman <[email protected]>
5+
Copyright (c) 2017 William Boman <[email protected]>
66
77
License: MIT (https://github.com/williamboman/angular-input-hints/blob/master/LICENSE)
88
*/
@@ -18,17 +18,16 @@ angular.module('wb.inputHints', [
1818
angular
1919
.module('wb.inputHints.directive', [])
2020

21-
.directive('inputHints', ['inputHints',
22-
function (inputHints) {
21+
.directive('inputHints', ['InputHints', '$parse',
22+
function (InputHints, $parse) {
2323
return {
2424
restrict: 'A',
2525
link: function (scope, element, attr) {
2626
var userConfig = {
2727
waitBeforeDeleteMs: attr.waitBeforeDeleting || attr.waitBeforeDelete,
2828
waitInBetweenMs: attr.waitInBetween,
2929
writeSpeedMs: attr.writeSpeed,
30-
deleteSpeedMs: attr.deleteSpeed,
31-
delimiter: attr.delimiter
30+
deleteSpeedMs: attr.deleteSpeed
3231
};
3332

3433
// Unset non-existing config values.
@@ -38,9 +37,8 @@ angular
3837
}
3938
});
4039

41-
var ticker = new inputHints(userConfig);
42-
43-
ticker.placeholders = attr.inputHints;
40+
var placeholders = $parse(attr.inputHints)(scope);
41+
var ticker = new InputHints(userConfig, placeholders);
4442

4543
ticker.onTick = function (newPlaceholderText) {
4644
element.attr('placeholder', newPlaceholderText);
@@ -55,25 +53,26 @@ angular
5553
angular
5654
.module('wb.inputHints.service', [])
5755

58-
.provider('inputHints', function () {
56+
.provider('InputHints', function () {
5957
var config = this.config = {
6058
waitBeforeDeleteMs: 2000,
6159
waitInBetweenMs: 300,
6260
writeSpeedMs: 100,
63-
deleteSpeedMs: 60,
64-
delimiter: '|'
61+
deleteSpeedMs: 60
6562
};
6663

6764
this.$get = ['$timeout',
6865
function ($timeout) {
6966

70-
function Ticker(userConfig) {
67+
function Ticker(userConfig, placeholders) {
7168
userConfig = userConfig || {};
7269
this.currentPlaceholderText = '';
7370
this.currentPlaceholdersIndex = 0;
7471
this.currentPlaceholderIndex = 0;
7572
this.isDeleting = false;
7673
this.timeout = undefined;
74+
this.placeholders = placeholders;
75+
debugger
7776

7877
this.config = angular.copy(config);
7978
angular.extend(this.config, userConfig);
@@ -84,11 +83,6 @@ angular
8483
if( !this.placeholders ) {
8584
throw new TypeError('[wb.inputHints] This instance of Ticker is missing Ticker.placeholders property.');
8685
}
87-
this.placeholders = this.placeholders.split(this.config.delimiter);
88-
89-
if( this.userConfig ) {
90-
angular.extend(this.config, this.userConfig);
91-
}
9286

9387
if( !this.onTick || typeof this.onTick !== 'function' ) {
9488
throw new TypeError('[wb.inputHints] This instance of Ticker is missing a valid Ticker.onTick callback function.');

dist/angular-input-hints.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-input-hints",
33
"description": "Animates input placeholders to make it look like they are being typed in realtime.",
4-
"version": "1.0.0",
4+
"version": "2.0.0",
55
"author": {
66
"name": "William Boman",
77
"email": "[email protected]",

0 commit comments

Comments
 (0)