小编Nit*_*tin的帖子

NullInjectorError:Angular 6中没有AnimationBuilder的提供程序

您好,我使用Angular 6以及材料设计

我已经包括了材料和动画的所有依赖关系

在编译时没有给出错误,但是在浏览器渲染时出现了以下错误在此处输入图片说明

我已经导入了所有必需的依赖项

import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';

AppComponent.html:40 ERROR Error: taticInjectorError(AppBrowserModule)[FuseSidebarComponent -> AnimationBuilder]: 
 StaticInjectorError(Platform: core)[FuseSidebarComponent -> AnimationBuilder]: 
NullInjectorError: No provider for AnimationBuilder!
at NullInjector.push../node_modules/@angular/core/fesm5/core.js.NullInjector.get (core.js:1034)
at resolveToken (core.js:1271)
at tryResolveToken (core.js:1216)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1113)
at resolveToken (core.js:1271)
at tryResolveToken (core.js:1216)
at StaticInjector.push../node_modules/@angular/core/fesm5/core.js.StaticInjector.get (core.js:1113)
at resolveNgModuleDep (core.js:8161)
at NgModuleRef_.push../node_modules/@angular/core/fesm5/core.js.NgModuleRef_.get (core.js:8849)
at resolveDep (core.js:9214)



import { animate, AnimationBuilder, AnimationPlayer, style } from '@angular/animations';
import { DOCUMENT } from '@angular/common';
@Injectable({
providedIn: 'root'
})
export class …
Run Code Online (Sandbox Code Playgroud)

angular angular-animations angular6

5
推荐指数
1
解决办法
5838
查看次数

Javascript从具有最小值的数组获取对象,并且需要查找最小值然后查找对象

我在对象中的对象数组有不同的键,所以我希望对象在该数组中具有最小值

list = [
{
'id':4,
'name':'nitin',
'group':'angularjs'
},
{
'id':1,
'name':'nitin',
'group':'angularjs'
},
{
'id':2,
'name':'nitin',
'group':'angularjs'
},
{
'id':3,
'name':'nitin',
'group':'angularjs'
}]
Run Code Online (Sandbox Code Playgroud)

我试过了

var minValue = Math.min.apply(Math, list.map(function (o) {
                return o.id;
            }))
Run Code Online (Sandbox Code Playgroud)

但它只返回id而不是整个对象然后我必须为get对象做更多的过滤器

有找到对象的直接方法吗?

javascript jquery

3
推荐指数
2
解决办法
1766
查看次数

angular ng repeat禁用除第一项以外的所有项目

我有一个项目清单.每个项目都在div中.我想只显示第一项启用,其他显示已禁用.

AngularJs

angular.module('example', [])
.controller('myCtrl', function Ctrl($scope) {
    $scope.items = [1,2,3];
});
Run Code Online (Sandbox Code Playgroud)

HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<div ng-app="example" ng-controller="myCtrl">
   <div ng-repeat="item in items">{{item}}</div>
</div>
Run Code Online (Sandbox Code Playgroud)

javascript jquery angularjs

2
推荐指数
1
解决办法
1285
查看次数

CKeditor组件,角度为4

我是Angular4的新手

我想在Angular4中集成CKeditor

当我按照这个 url但是Angular 2没有在Angular 4中工作.

因为我在那里检查

System.config({
"map": {
  "ng2-ckeditor": "npm:ng2-ckeditor",
},
"packages": {
  "ng2-ckeditor": {
    "main": "lib/index.js",
    "defaultExtension": "js",
  },
}
});
Run Code Online (Sandbox Code Playgroud)

但Angular 4中没有System.config的任何选项

然后我已经集成froala但它提供许可证错误,也不允许配置,我尝试但它没有影响

如何在Angular4中集成CKeditor?

javascript ckeditor angular

2
推荐指数
1
解决办法
8163
查看次数