在角分量中使用velocity.js

问题描述 投票:0回答:1

我正在尝试创建实现this codepen script的角度组件。

我使用ng g component <my-comp-name>创建了该组件,因此我的组件中有3个HTML,CSS和ts文件。

我刚刚复制粘贴了HTML和CSS部分。 JS部分始终是合并的难点。主要是因为我有这个速度函数。

我尝试了以下link。我使用了npm install angular-velocity --save,并在组件HTML中添加了<script src="node_modules/angular-velocity/angular-velocity.min.js"></script>

我试图查看是否可以更改以下行:

<div ng-view class="velocity-opposites-transition-slideUpIn hover-notify">Hover Me!</div>但是“悬停我”中没有显示动画!文字。

我在做什么错?还是有更简单的方法来合并这些代码?

angular velocity.js
1个回答
0
投票

您可以尝试在node_modules/angular-velocity/angular-velocity.min.js的脚本部分中添加angular.json

"scripts": [
  "node_modules/angular-velocity/angular-velocity.min.js"
]

Edit:实际上,该脚本用于AngularJS,它不能与Angular一起使用。

© www.soinside.com 2019 - 2024. All rights reserved.