我已经将ng2-charts添加到我的项目中并显示2个图表 - 甜甜圈和条形图.因为我添加了,所以都显示为灰色
<base-chart class="chart"
[colors]="chartColors"
...
</base-chart>
Run Code Online (Sandbox Code Playgroud)
去component.template.html
和
public chartColors:Array<any> =[
{
fillColor:'rgba(225,10,24,0.2)',
strokeColor:'rgba(11,255,20,1)',
pointColor:'rgba(111,200,200,1)',
pointStrokeColor:'#fff',
pointHighlightFill:'#fff',
pointHighlightStroke:'rgba(200,100,10,0.8)'
}, ... (3x)
Run Code Online (Sandbox Code Playgroud)
到了 component.ts
是否需要更改颜色的任何其他包导入或设置错误?Chromes html检查器显示以下html输出呈现
ng-reflect-colors="[object Object],[object Object],[object Object]"
Run Code Online (Sandbox Code Playgroud) 我最近开始在我的应用程序中实现延迟加载.我想知道是否有任何方法可以在angular-cli应用程序中生成新模块而不是手动创建它时创建routing.module.ts?
最初,当点击有文本的区域时,bootstrap v4手风琴是可折叠的.如何让它可以折叠到该div的整个区域.
这里是bootstrap的代码.
<div id="accordion" role="tablist" aria-multiselectable="true">
<div class="card">
<div class="card-header" role="tab" id="headingOne">
<h5 class="mb-0">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
Collapsible Group Item #1
</a>
</h5>
</div>
<div id="collapseOne" class="collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="card-block">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid.
</div>
</div>
</div>
<div class="card">
<div class="card-header" role="tab" id="headingTwo">
<h5 class="mb-0">
<a class="collapsed" data-toggle="collapse" data-parent="#accordion" href="#collapseTwo" aria-expanded="false" aria-controls="collapseTwo">
Collapsible Group Item #2
</a>
</h5>
</div>
<div id="collapseTwo" class="collapse" role="tabpanel" aria-labelledby="headingTwo">
<div …Run Code Online (Sandbox Code Playgroud) 我有一个使用角度2的设计,其中所有其他组件加载的标题组件,导航栏组件和主体组件.如下图所示
所以基本上,在标题组件中,我想显示当前状态.并且在当前状态的底部,我想显示用户的先前状态.
问题:为了实现这一点,我在角度中使用了组件交互技术.
重新加载应用后,它会显示当前和
后退状态的默认值.
在用户直接登陆到正文中的子组件的特定页面的场景中,它显示当前和后退状态的默认值.
由于angular遵循组件架构,因此我想要一种更好的方法来实现此功能.
如果我直接进入图片中第3部分的子组件,我的标题组件应根据标题组件中的特定页面获取标题/当前状态.
当ngOnInit I传递当前状态值时,我的解决方案是在每个组件中.我也解析以前的状态值.因此,标头组件显示它,因为服务是使用此链接中的技术编写的 - https://angular.io/docs/ts/latest/cookbook/component-communication.html
但是有些情况下我从服务器获取数据并且必须更新标头当前状态.在那里,我看到根本没有显示.
需要帮助以获得良好的解决方案
PS - 由于这种机制在不同的文件中,并且有点复杂,我无法更新代码模板
angular2-routing angular2-services ngcomponentrouter angular2-components angular