简体   繁体   中英

how can i bind datepicker js data to angular?

i try to bind these 2 following files into my Angular project:

<script src='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.6.4/js/bootstrap-datepicker.min.js'></script>
<script src='https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.8.0/locales/bootstrap-datepicker.de.min.js'></script>

creating custom JavaScript file in asset and binding it works fine.

but where can I bind these 2 files? there have no function name and idk how can I call them in the angular component. (I am new @js)

i try to add function name to the files (local saved) but it doesn´t work. what is the right syntax to add a function name to this files?

If what you're trying to do is simply adding a Bootstrap-style date picker in your Angular project, you might be better off using an Angular native component like this one: https://www.npmjs.com/package/@ng-bootstrap/ng-bootstrap

Datepicker demo:https://ng-bootstrap.github.io/#/components/datepicker/overview

when ever you want to add any external libraries in Angular always looking it in npm first. Here is a link, hope it'll help you solve your problem, https://www.itsolutionstuff.com/post/angular-8-bootstrap-4-datepicker-exampleexample.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM