PrimeNG Calendar error - JQuery is not defined

后端 未结 2 1583
不知归路
不知归路 2021-01-12 17:36

I want to use PrimeNG calendar in my app. When I run the code, I get the error:

ReferenceError: jQuery is not defined.

Other P

相关标签:
2条回答
  • 2021-01-12 18:17

    You need to add the dependencies:

    <!-- Datetimepicker, Slider, Schedule -->
    <script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
    <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-ui-timepicker-addon/1.6.1/jquery-ui-timepicker-addon.min.js"></script>
    
    0 讨论(0)
  • 2021-01-12 18:33

    You can also add just this:

    <script src="node_modules/primeui/primeui-ng-all.min.js"></script>

    Or, if you're using the angular-cli like me you can npm i primeui and add this to your angular-cli.json:

    "scripts": ["../node_modules/primeui/primeui-ng-all.min.js"]

    Update

    in beta.19 The dependency of JQuery has been removed.

    Reference: http://blog.primefaces.org/?p=4149

    0 讨论(0)
提交回复
热议问题