腾讯云
开发者社区
文档
建议反馈
控制台
登录/注册
首页
学习
活动
专区
圈层
工具
MCP广场
文章/答案/技术大牛
搜索
搜索
关闭
发布
文章
问答
(9999+)
视频
沙龙
1
回答
我
的
宿主
组件
外部
的
Angular
-
access
ng-template
angular
如何访问不属于我
的
主机
组件
的
模板,而不将它们作为输入传递?更具体地说,
我
想这样做: @ViewChildren(ToolbarCustomTemplateDirective, {read: TemplateRef}) templates: QueryList<
浏览 18
提问于2020-02-02
得票数 0
3
回答
当为false时,
Angular
6 ngIf创建空元素
angular
我
对Anguar6和ngIf有一个问题: <img src="../..="deleteproduit(i)" class="btn btn-primary">Supprimer</button> </div> <
浏览 0
提问于2020-07-04
得票数 1
1
回答
在
Angular
4中实现包装器
组件
的
正确方式?
angular
、
wrapper
我
正在用
Angular
4开发一个新
的
应用程序。
我
想用包装器
组件
来构建
我
的
整个应用程序,这样
我
就可以在需要
的
时候换出实际
的
组件
。这对于简单
的
控件很容易工作,但对于我们想要拆分成独立
组件
的
复杂控件就不是这样了。最好
的
例子是标签,因为要求相当稳定:标签和内容面板
的
标签列表,我们可以显示/隐藏。<
浏览 0
提问于2017-09-08
得票数 9
2
回答
Google 2+Google地图在输入后自动完成,追加[Dom管理]
angular
我
曾使用“角2+谷歌地图位置自动完成”搜索。它基本上是这样
的
输入类型文本:
我
想知道列表
的
情况,它是在输入一些文本之后出现
的
。<
浏览 0
提问于2017-11-13
得票数 12
回答已采纳
2
回答
通过条件逻辑在不同位置
的
角度显示投影内容
angular
、
angular-content-projection
我
正在构建一个角
的
头
组件
,并希望根据输入inputTwoRows是否设置为true/false来显示DOM结构中不同位置
的
导航。nav通过内容投影- ng-content添加到标题
的
模板中。
我
尝试在模板中
的
不同位置将2 ng-content包装在ng-templates中,并添加了ngIf以有条件地显示它们。然而,模板试图显示相同
的
预计内容。下面是header.component.html
的
代码<header&g
浏览 9
提问于2022-07-27
得票数 1
1
回答
“[ngTemplateOutet]”正在工作,但“*ngTemplateOutlet”不起作用
angular
、
typescript
我
试图制作一个使用ngTemplateOutlet来挑选
ng-template
的
组件
,但是
我
就是不明白为什么*ngTemplateOutlet在这里不能工作(但是ngTemplateOutlet可以工作以下是
我
的
代码<div class="frame-wrapper"> <ng-container [ngTemplateOutlet]="(windowWidth&
浏览 11
提问于2019-07-17
得票数 1
2
回答
引导css在
angular
中动态注入
的
组件
上不起作用
css
、
angular
、
bootstrap-4
我
有一个代码块,像这样: <div class="row"> </div>dynamicComponents是一个
我
用来注入动态
组件
的
指令。所有的应用程序都在
浏览 0
提问于2020-05-29
得票数 0
5
回答
Angular
7可重用ng模板
angular
、
angular2-template
、
ngx-datatable
、
ng-template
我
目前正在创建一个可重用
的
ngx-datatable包装器
组件
,它将在
我
的
应用程序中使用,因为每个表都不同,
我
需要多个
ng-template
来满足每个
组件
的
需要。
我
的
想法是创建一个SharedTemplates
组件
,该
组件
将包含许多ng模板,并通过简单地将它们作为公共属性来公开它们,例如: @ViewChild("yesNoTemplate")
浏览 23
提问于2020-03-11
得票数 0
1
回答
createEmbeddedView和createComponent有什么区别?
angular
我
搞不清createEmbeddedView和createComponent
的
用例,也就是什么时候该使用哪一个。 请拿出一些案例,告诉我们在“动态创建场景”中使用它们
的
合适设置。
浏览 2
提问于2017-09-21
得票数 21
回答已采纳
1
回答
为什么即使ViewContainerRef中有其他
组件
,它
的
长度也是0
angular
我
有一个简单
的
组件
: constructor(private vc: ViewContainerRefvoid { }<h1>Hello {{name}}</h1>因此,这里显然有green
组件
在ViewContain
浏览 6
提问于2017-03-02
得票数 4
回答已采纳
1
回答
ng-template
中
的
ng-content始终创建内容,即使模板未呈现
angular
、
angular2-template
、
ng-template
、
angular2-ngcontent
我
遇到了一个奇怪
的
bug,在
ng-template
中包装了一个ng-content。假设
我
有一个在outer-component中显示
的
组件
inner-component <ng-container *ngIf="condition" [ngTemplateOutlet]="test"=false,则不出所料,
我
的
inner-component永远不会由
Angular
创建(在调试时,ngO
浏览 5
提问于2020-09-10
得票数 2
2
回答
无法使用PrimeNg DataTable居中对齐文本
css
、
twitter-bootstrap
、
angular
、
primeng
、
primeng-datatable
我
正在尝试同时使用PrimeNg和bootstrap。也许这本质上是不好
的
?似乎仅有PrimeNg是不够
的
。 <
n
浏览 2
提问于2017-10-25
得票数 3
回答已采纳
1
回答
从动态添加
的
组件
调用
宿主
或父
组件
的
方法
的
正确方式是什么?
javascript
、
angular
我
想知道从动态添加
的
组件
调用
宿主
组件
中声明
的
greet()方法
的
正确方式import { ViewChild, ViewContainerRef, import { OneComponent } from
浏览 19
提问于2021-02-17
得票数 0
回答已采纳
6
回答
Angular
2:将动态
组件
作为容器
的
子级插入到DOM中
angular
有没有办法将
组件
作为
Angular
2中DOM标签
的
子(而不是兄弟)动态插入?有很多示例可以将动态
组件
作为给定ViewContainerRef
的
标记
的
兄弟项插入,例如(对于RC3): selector: '...具有相同
的
结果,它仍然将生成
的
组件
作为兄弟项插入,而不是子项。
我
可以接受这样
的
解决方案:模板为空,并且动态
组件
被插入到模板中(在<e
浏览 106
提问于2016-06-29
得票数 37
回答已采纳
1
回答
如何使角度部件和服务更加干燥?
angular
、
dry
我
发现自己在
我
所有的角度应用程序中都遇到了同样
的
问题,而且
我
正经历着最困难
的
时刻,
我
知道Google需要什么解决方案。
我
无法抗拒
的
感觉,<em
浏览 5
提问于2022-03-09
得票数 0
回答已采纳
1
回答
共享
ng-template
angular
、
angular-template
是否可以在多个
组件
之间共享TemplateRef?
我
所看到
的
是在
组件
中定义模板,使用ViewChild捕获模板,然后在该
组件
或其中一个
组件
上使用该引用。
我
想在lib中提供这个模板,这样它们就可以在任何地方使用。
浏览 0
提问于2019-08-06
得票数 0
2
回答
如何将ng-content放入模板
angular
如果
我
有一个
组件
BaseComponent,它看起来像 <ng-container *ngTemplateOutlet="tpl"></ng-container> 和另一个
组件
OtherComponent--> </
ng-template
>
我
能不能让传递到
组件
中
的
ng-content暴露给模板?
我
试图实现
的
是在应用程序中
的
其他地方定
浏览 11
提问于2019-01-24
得票数 0
10
回答
无法读取未定义
的
属性“”viewContainerRef“”
angular
、
angular-directive
、
angular-components
我
正在尝试显示一个与
angular
文档中
的
示例类似(不精确)
的
动态
组件
。
我
有一个viewContainerRef
的
动态指令 selector: '[dynamicComponent]'export class DynamicComponentDirective{} 摘录自
组件</
浏览 3
提问于2018-01-19
得票数 26
1
回答
如果用户登录,则角6更改
组件
angular
、
authentication
、
asp.net-core
、
jwt
使用基于JWT
的
实现和角度6,基于用户是否登录
的
隐藏/显示
组件
的
最佳方法是什么?最好有一个可观察
的
用户对象,其中包含与用户相关
的
信息。这需要护卫吗?后端使用
的
是.NET Core2.1,不确定这是否有区别。大部分代码都是从
我
用来学习角
的
一个旧
的
角Firebase项目中提取出来
的
,但是出于几个原因,
我
切换到了.NET核心。这是很好
的
实时更新
的</e
浏览 0
提问于2018-07-15
得票数 3
1
回答
为什么Swiper没有在离子模式下初始化?
angular
、
ionic-framework
、
slider
、
swiper
我
正在尝试在离子模式下使用Swiper
Angular
,但是swiper没有被初始化。--container--> #swiper [spaceBetween]="50</
ng-template
> <
ng-template
swiperSlide>Slide 2<
浏览 9
提问于2021-11-04
得票数 0
回答已采纳
点击加载更多
热门
标签
更多标签
云服务器
对象存储
ICP备案
云点播
腾讯会议
活动推荐
运营活动
广告
关闭
领券