Topic: angular2 mdbootstrap $(…).pickadate is not a function

nechmi badreddin free asked 7 years ago


I have been creating an application using Angular2 and mdbootstrap. when I call $('.datepicker').pickadate() ,I'm getting the error EXCEPTION: $(...).pickadate is not a function app.component.ts
import {Component, OnInit, AfterViewInit} from '@angular/core';
declare var $: any;
@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent  implements AfterViewInit{
  title = 'app works!';

  ngAfterViewInit() {
    $('.datepicker').pickadate();
  }

}
app.component.html
<div class="md-form">
  <input placeholder="Selected date" type="text" id="date-picker-example" class="form-control datepicker">
  <label for="date-picker-example">Try me...</label>
</div>
index.html
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/css/mdb.min.css" />
  <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mdbootstrap/4.3.0/js/mdb.min.js"></script>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
Thanks in advance.

Adrian Sawicki free answered 6 years ago


We're not supporting AngularJS(Angular 1). Maybe someone on our forum might help you solve this problem.

AalokitS free answered 6 years ago


Hi, I am using angular 1.5 v. I am also facing the same issue.

Piotr Bender free answered 7 years ago


Hello,In response to your issue, I wanted to let you know about just released MDBootstrap Angular kit, that may be a sufficient solution to this or any other issues you have had with Angular integration so far.The kit can be found at the following link:https://mdbootstrap.com/angular/It contains all the components you could find in MDB jQuery version.We encourage you to try it out and report any bugs or issues at contact@mdbootstrap.com with [Angular] prefix or create a thread on this forum.Have a great day!


Adrian Sawicki free answered 7 years ago


Hello Nechmi Badreddin, We aren't supporting angular2 yet. However, we started working on it and we hope to finish it as soon as possible. Regards

Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Specification of the issue

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags