亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

javascript - The datepicker control provided by angualr-ui-bootstrap, the binding to ng-model fails.
淡淡煙草味
淡淡煙草味 2017-05-19 10:34:52
0
1
785

The two input boxes have been bound with ng-model and are used to present data obtained from the background. However, because uib-datepicker-popup="yyyy-MM-dd HH:mm:ss" is written in the first input, the bound data cannot be written to the input.

This picture is the effect that appears after clicking the time control. Because the first input formats the time, the displayed data meets the requirements.

The current question is how to ensure that the first input box after the page is loaded can not only display the obtained data, but also ensure that the time obtained when clicking the time control button meets the format requirements?

This is the first time I ask a question. The language is a bit confusing. I hope friends who see it will forgive me!
I hope friends who love me can answer this question

淡淡煙草味
淡淡煙草味

reply all(1)
phpcn_u1582

I have encountered this problem before, ng-bootstrap的時間格式默認是date object,我也遇到過這個問題,我寫了個directivedate-picker的事件對象直接轉(zhuǎn)成string.

.directive('dateModelFormat', ['dateFilter', '$parse', function(dateFilter, $parse){
    return {
        restrict: 'A',
        require:'?ngModel',
        link: function(scope, element, attr, ngModel){
            ngModel.$parsers.push(function(viewValue){
                return dateFilter(viewValue, 'yyyy-MM-dd');
            });
        }
    }
}])
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template