Skip to content

Commit 046d64d

Browse files
committed
Up doc. With translations
1 parent d030193 commit 046d64d

File tree

3 files changed

+22
-9
lines changed

3 files changed

+22
-9
lines changed

docs/_layouts/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<title>{{ site.title | default: site.github.repository_name }}</title>
1515
</head>
1616

17-
<body ng-app="app">
17+
<body ng-app="app" ng-controller="MainCtrl as $ctrl">
1818

1919
<!-- HEADER -->
2020
<div id="header_wrap" class="outer">

docs/index.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,13 @@
1212

1313
### Init with a date
1414

15-
<div ng-controller="InitSampleCtrl as $ctrl">
16-
<input-birthday data-ng-model="$ctrl.birthdate"></input-birthday>
17-
<pre data-ng-bind="$ctrl.birthdate"></pre>
18-
</div>
15+
<input-birthday data-ng-model="$ctrl.birthdate"></input-birthday>
16+
<pre data-ng-bind="$ctrl.birthdate"></pre>
1917

2018
### Init with default today date
2119

22-
<input-birthday data-ng-model="$ctrl.birthdate" init-today="true"></input-birthday>
23-
<pre data-ng-bind="$ctrl.birthdate"></pre>
20+
<input-birthday data-ng-model="birthdate2" init-today="true"></input-birthday>
21+
<pre data-ng-bind="birthdate2"></pre>
2422

2523
## Usage
2624

docs/js/app.js

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
(() => {
22
'use strict';
33

4-
angular.module('app', ['angularjs-input-birthday'])
5-
.controller('InitSampleCtrl', $scope => {
4+
angular.module('app', [
5+
'pascalprecht.translate',
6+
'angularjs-input-birthday'])
7+
.config(['$translateProvider', $translateProvider => {
8+
$translateProvider.preferredLanguage('fr');
9+
$translateProvider.translations('fr', {
10+
'birthday-input': {
11+
'year-label': 'Choose year',
12+
'month-label': 'Choose month',
13+
'day-label': 'Choose day',
14+
years: 'Years',
15+
months: 'Months',
16+
days: 'Days'
17+
}
18+
});
19+
}])
20+
.controller('MainCtrl', $scope => {
621
$scope.birthdate = new Date('1990-02-25');
722
});
823
})();

0 commit comments

Comments
 (0)