我在Visual Studio中更新了Xamarin iOS,并且调试停止了对可移植库的工作,但它在iOS项目中工作.
但是,如果我将调试从iPhoneSimulator更改为iPhone,反之亦然,pcl内的断点开始工作,但如果我更改pcl内的代码,则断点不会再出现.
这些是我正在使用的版本.Xamarin 3.11.445.0 Xamarin.iOS 8.10.0.0 Visual Studio 2013版本12.0.31101.00更新4
有点令人沮丧的是无法调试,花了一整天试图解决这个问题:s
谢谢!
将子div的高度绑定到父高度似乎不起作用
<div #parentdiv style="background-color:blue;height:1000px">
<div style="background-color:red" [style.height.px]="parentdiv.height">
hallo
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
这是一个plunkr https://plnkr.co/edit/ifWbZSQ9FeiV6n1g9bes?p=preview
我正在尝试使用命名网点。在app.routes中,我有以下路径。
{path:'home',组件:HomeComponent,插座:'home'}
app.component.html包含
<router-outlet name="home"></router-outlet>
<router-outlet></router-outlet>
Run Code Online (Sandbox Code Playgroud)
家庭插座永远不会显示家庭组件。如果我从路由器路径中删除插座名称,则未命名的插座将显示HomeComponent。我正在使用最新的Angular2。您知道为什么命名插座不起作用吗?
[更新]这是工作中的plunkr,您只需要查看app.comoponent.ts即可。如果您单击危机中心或Hereos的链接,我是否希望导航的组件出现在红色的命名插座区域内?
https://plnkr.co/edit/l2Li0sLbbEIRZCppRlvF?p=preview
谢谢你的帮助!
我尝试在以下情况下使用 routerLinkActive
'./path1' 链接路径 1 应处于活动状态。
'./path1?param1=70000¶m2=test2' 链接 path1 应该处于活动状态。
'./path1/path2' 链接路径2 应该处于活动状态。
<a [routerLink]="./path1" [routerLinkActiveOptions]="{ exact: true }"
[routerLinkActive]="['active']">My link</a>
Run Code Online (Sandbox Code Playgroud)
带有 routerLinkActiveOptions 的 path1 和 queryparams 未激活。
如何配置 routerLinkActive 以使用任何查询参数?
我正在尝试过滤 div 元素的子元素。
我可以通过 Angular ViewChild 直接访问父级 div,如果我像这样打印子级
console.log(this.myParentDiv.nativeElement.children);
Run Code Online (Sandbox Code Playgroud)
我在 Chrome 中得到以下输出:
我需要将其转换为数组才能过滤 div。但是如果我像这样转换它
console.log(Array.from(this.myParentDiv.nativeElement.children));
Run Code Online (Sandbox Code Playgroud)
它返回一个空数组。
知道为什么它返回空吗?
我正在使用构建工具2017在TFS2017 Update 3上构建Web服务项目。出现以下错误
C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ 15.0 \ Bin \ Microsoft.CSharp.CurrentVersion.targets(322,5):错误MSB4019:导入的项目“ C:\ Program Files(x86) )\ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ 15.0 \ Bin \ Roslyn \ Microsoft.CSharp.Core.targets”未找到。确认声明中的路径正确,并且文件在磁盘上。
我需要采取什么步骤来解决此错误?
我有以下代码,我从文件中提取所有方法。
var tree = file.GetSyntaxTreeAsync().Result;
var methodDeclarations = tree.GetRoot().DescendantNodes().OfType<MethodDeclarationSyntax>().ToList();
Run Code Online (Sandbox Code Playgroud)
我怎样才能只获得公共功能?
我想在我的网页的不同部分使用嵌套模板.对于不同的部分,我需要从嵌套模板中的数组中获取值.我不能使用for循环,因为每个部分在网站上有不同的类和位置.是否可以将变量传递给嵌套模板?以下代码简化了我要实现的目标:
<script id="myBtnTmpl" type="text/x-jsrender">
<button class="btn">
{{:myData.myArray[INDEX_VARIABLE].btnName}}
</button>
</script>
// Here I want to use INDEX_VARIABLE = 0
<div class="BigButton">
{{if myData tmpl="myBtnTmpl"/}}
</div>
// Here I want to use INDEX_VARIABLE = 1
<div class="MediumButton">
{{if myData tmpl="myBtnTmpl"/}}
</div>
// Here I want to use INDEX_VARIABLE = 2
<div class="SmallButton">
{{if myData tmpl="myBtnTmpl"/}}
</div>
Run Code Online (Sandbox Code Playgroud)
另一个问题:当使用嵌套模板时,可以包含嵌套模板,如{{tmpl ="myBtnTmpl"/}},而不使用if语法?
谢谢!
我正在使用阴影穿孔css作为我的一种风格.但我在scss中有颜色代码,我想在风格中使用.是否可以让阴影穿过scss文件?
@Component({
selector: 'my-selector',
styles: [
require('./my.style.scss'),
':host >>> .mystyle { background-color: green }'
],
templateUrl: './my.template.html'
})
Run Code Online (Sandbox Code Playgroud) 我有以下结构:app.component.html包含以下组件:
<componentA>
<router-outlet></router-outlet>
Run Code Online (Sandbox Code Playgroud)
我将componentB注入路由器插座,componentB有自己的路由器插座.
<componentB><router-outlet></router-outlet></componentB>
Run Code Online (Sandbox Code Playgroud)
我在ComponentB的路由器插座中注入componentC
<componentC>
Run Code Online (Sandbox Code Playgroud)
我想从ComponentA向ComponentC发送一个事件.
我正在尝试使用服务来实现这一点,方法是将其注入ComponentA,ComponentA发送事件,ComponentC通过注入的服务订阅事件.组件C未接收事件.
但是,如果我在ComponentB中移动componentA,则事件会成功发送到ComponentC.
当ComponentA位于app.component.html的根目录时,如何从ComponentA向ComponentC发出事件?
[UPDATE]
我在双向服务上遵循了示例,但仍未收到该事件.这是代码:
我的服务:
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
@Injectable()
export class MyService {
private mySource = new Subject<string>();
source$ = this.mySource.asObservable();
sendEvent(stringParam: string) {
this.mySource.next(stringParam);
}
}
Run Code Online (Sandbox Code Playgroud)
组件A发送事件
this.myService.sendEvent("test");
Run Code Online (Sandbox Code Playgroud)
组件C订阅并侦听事件
this.subscription = this.myService.source$.subscribe(stringParam => {
console.log('Received event: ' + stringParam);
});
Run Code Online (Sandbox Code Playgroud)
我正在使用Angular RC5.知道我错过了什么吗?