Home > Back-end >  how can i bind datepicker js data to angular?
how can i bind datepicker js data to angular?

Time:02-16

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?

CodePudding user response:

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

CodePudding user response:

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

  • Related