我试图将https://github.com/vimeo/vimeo.js与我的angular2项目一起使用。 这就是我所做的。
import {Vimeo} from '../../node_modules/vimeo';
在导入行我收到错误
' [ts]模块' ../../ node_modules / vimeo'被解决了 ' / Users /../ GitHub / Angular2-GettingStarted / APM - Final / node_modules / vimeo / index.js',但是' - allowJs'未设置'
我做错了什么?是否有一个使用此api的Angular2示例,我可以解决这个问题?
谢谢,
答案 0 :(得分:0)
这不是一个es6库,所以请尝试代替。
<?php
// Set first exam date
$firstexamdate = "2015-08-20";
// Work out date that is 18 months from first exam date
$add_18_months = strtotime($firstexamdate . ' + 18 months');
$eighteen_months_time = date('Y-m-d',$add_18_months);
// Check
echo "Date of first exam: " . $firstexamdate . "<br>";
echo "18 months from this date: " . $eighteen_months_time . "<br>";
// Work out diff between cut-off date and today
$today = date('Y-m-d');
$date1 = new DateTime($eighteen_months_time);
$date2 = new DateTime($today);
$difference = $date1->diff($date2);
// Display
echo "Difference/time remaining: " . $difference->y . " years, " . $difference->m . " months, " . $difference->d . " days " . "<br";
// BELOW CODE NOT WORKING
// Display $difference as string
echo $difference->format('Y-m-d');
// Output correct warning colour
if ($difference <= /* 18 months */ and >= /* 6 months */ {
echo "Green warning: At least 6 months left.";
} elseif ($difference <= /* 5 months */ and >= /* 2 months */ {
echo "Orange warning: Less than 5 months left.";
} elseif ($difference <= /* 1 months */ and >= /* 0 months */ {
echo "Red warning: Less than one month left.";
}
?>
我自己没有使用它,但看起来像这样的东西可以解决问题!