Skip to content Skip to sidebar Skip to footer

How To Import 'bootstrap-datetimepicker' Into Aurelia Project

I'm trying to add 'Eonasdan/bootstrap-datetimepicker' into an Aurelia with typescript project and call this.birthDateDatePicker.datetimepicker(); in the 'attached' method from the

Solution 1:

aha, it wasn't clear to me what you were doing when we were chatting in the gitter. I think I see the issue now...

The bootstrap-datetimepicker is a jQuery plugin, loading the module installs the plugin's functionality in jquery. It may not export anything. If it does export something, it should be the jquery object.

Try one of these:

import $ from'Eonasdan/bootstrap-datetimepicker';
import $ from'jquery';
import'Eonasdan/bootstrap-datetimepicker';

In any of these cases, there's no need to involve dependency injection (@inject etc). Use the $ variable directly.

Solution 2:

if you use aurelia-skeleton as boilerplate

import $ from'bootstrap';

EDITED: Also use import 'Eonasdan/bootstrap-datetimepicker'; to add datetimepicker as jquery module to globals

Post a Comment for "How To Import 'bootstrap-datetimepicker' Into Aurelia Project"