SrA*_*Axi 12 typescript ng2-bootstrap angular-cli angular
我一直在尝试这个错误的几个解决方案,但没有找到任何成功的方法来克服这个:没有提供TemplateRef!
错误日志:
EXCEPTION:未捕获(在承诺中):错误:./FooterComponent类中的错误FooterComponent - 内联模板:15:20导致:没有TemplateRef的提供者!错误:./FooterComponent类中的错误FooterComponent - 内联模板:15:20导致:没有TemplateRef的提供程序!
未处理的Promise拒绝:./FooterComponent类中的错误FooterComponent - 内联模板:15:20导致:没有TemplateRef的提供者!; 区域:角; 任务:Promise.then; 值:
footer.component.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'sa-footer',
templateUrl: './footer.component.html'
})
export class FooterComponent implements OnInit {
constructor() {}
ngOnInit() {}
}
Run Code Online (Sandbox Code Playgroud)
footer.component.html
<div class="page-footer">
<div class="row">
<div class="col-xs-12 col-sm-6">
<span class="txt-color-white">myAPP © 2016</span>
</div>
<div class="col-xs-6 col-sm-6 text-right hidden-xs">
<div class="txt-color-white inline-block">
<i class="txt-color-blueLight hidden-mobile">Last account activity <i class="fa fa-clock-o"></i>
<strong>52 mins ago </strong> </i>
<div class="btn-group dropup" dropdown>
<button class="btn btn-xs dropdown-toggle bg-color-blue txt-color-white" dropdownToggle>
<i class="fa fa-link"></i> <span class="caret"></span>
</button>
<ul class="dropdown-menu pull-right text-left" dropdownMenu>
<li>
<div class="padding-5">
<p class="txt-color-darken font-sm no-margin">Download Progress</p>
<div class="progress progress-micro no-margin">
<div class="progress-bar progress-bar-success" style="width: 50%;"></div>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="padding-5">
<p class="txt-color-darken font-sm no-margin">Server Load</p>
<div class="progress progress-micro no-margin">
<div class="progress-bar progress-bar-success" style="width: 20%;"></div>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="padding-5">
<p class="txt-color-darken font-sm no-margin">Memory Load <span class="text-danger">*critical*</span>
</p>
<div class="progress progress-micro no-margin">
<div class="progress-bar progress-bar-danger" style="width: 70%;"></div>
</div>
</div>
</li>
<li class="divider"></li>
<li>
<div class="padding-5">
<button class="btn btn-block btn-default">refresh</button>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我试着做以下事情:
研究:但是,只有发现实际包含一些指令喜欢的模板答案/解决方案ngIf
,ngSwitch
等等.(忘记了*
,例如)
添加TemplateRef
到providers
.这就是我得到的:
类型'{selector:string; templateUrl:string; 提供者:typeof TemplateRef []; }'不能分配给'Component'类型的参数.属性"提供者"的类型是不兼容的.类型'typeof TemplateRef []'不能分配给'Provider []'类型.类型'typeof TemplateRef'不能分配给'Provider'类型.类型'typeof TemplateRef'不能分配给'FactoryProvider'类型.'typeof TemplateRef'类型中缺少属性'provide'.
我将尝试看看如何以某种方式添加TemplateRef
到应用程序的模块providers
.但我不知道这是否是解决方案.我希望有人在我继续研究的同时提出解决方案.
谢谢!:d
n00*_*dl3 30
研究:但只找到实际包含某些指令的模板的答案/解决方案,例如ngIf,ngSwitch等.(例如,忘记*)
*
在这里失踪:
<ul class="dropdown-menu pull-right text-left" dropdownMenu>
Run Code Online (Sandbox Code Playgroud)
应该
<ul class="dropdown-menu pull-right text-left" *dropdownMenu>
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)<div class="btn-group" dropdown> <button dropdownToggle type="button" class="btn btn-primary dropdown-toggle"> Button dropdown <span class="caret"></span> </button> <ul *dropdownMenu class="dropdown-menu" role="menu"> <li role="menuitem"><a class="dropdown-item" href="#">Action</a></li> <li role="menuitem"><a class="dropdown-item" href="#">Another action</a></li> <li role="menuitem"><a class="dropdown-item" href="#">Something else here</a></li> <li class="divider dropdown-divider"></li> <li role="menuitem"><a class="dropdown-item" href="#">Separated link</a> </li> </ul> </div>
归档时间: |
|
查看次数: |
11696 次 |
最近记录: |