$scope.property = new Property();
$scope.property.propertyType = {};
$scope.propertyTypes = [
{ value: 'ResidentialPlot', name: 'Residential Plot' },
{ value: 'CommercialPlot', name: 'Commercial Plot' },
{ value: 'Apartment', name: 'Apartment/Flat' },
{ value: 'Townhouse', name: 'Townhouse' },
{ value: 'House', name: 'Single Family House' },
{ value: 'Commercial', name: 'Commercial Property' }
];
<label for="ptype" class="col-sm-2 control-label">Property Type</label>
<p>Populated: {{property.propertyType}}</p>
<ui-select ng-model="property.propertyType" id="ptype" theme="selectize" ng-disabled="disabled" style="width: 300px;" title="Choose Property Type">
<ui-select-match placeholder="Select a Property Type">{{$select.selected.value}}</ui-select-match>
<ui-select-choices repeat="propType in propertyTypes">
<span ng-bind-html="propType.name"></span> …Run Code Online (Sandbox Code Playgroud) 这是我第一次涉足 RxJS,所以如果有更好的解决方案,我完全赞成。我的目标是收集相关对象并在代码中加入它们(本质上是一个 sql 左连接)。这源于我使用 Angular In Memory API 对象作为数据库,直到它建立为止。
当我结合 Plans、Specieses、Codebooks、UpstreamModalities 和 TissueProcessions 时,此代码按预期工作。当我包含 Probes、Imaging 和 Analysises 流时,我对读取错误 blob 感到头疼。基本上 array.map 函数中的每一行都会抛出 TS2349 错误,即使是在添加其余三个源之前工作的那些。
import { Component, OnInit } from '@angular/core';
import { Plan } from '../plan';
import { PlanService } from '../plan.service';
import { DatabaseService } from 'src/app/serivces/database.service';
import { combineLatest } from 'rxjs';
import { map, tap } from 'rxjs/operators';
@Component({
selector: 'app-plans-list',
templateUrl: './plans-list.component.html',
styleUrls: ['./plans-list.component.scss']
})
export class PlansListComponent implements OnInit {
plans$ = combineLatest([
this.planService.getPlans(), …Run Code Online (Sandbox Code Playgroud) 我正在设置我的站点身份验证设置以使用 AAD 提供程序。大多数模板都受到尊重。但是,unauthenticatedClientAction和allowedAudiences没有被正确分配。我观察到“允许匿名”并且没有分配“允许的观众”。
请注意,我正在使用 ARM Template API 2018-02-01。由于文档原因,此问题可能仍然存在,如果您提供答案,请注意其解决的 ARM 模板版本。
此外,为 ARM 文档团队创建一个问题以更正任何问题。
这是我的这些设置的模板段。它嵌套在我的网站模板中的资源下。
根 > Microsoft.Web/站点 > 资源
{
"type": "config",
"name": "web",
"apiVersion": "2016-08-01",
"location": "[parameters('app-location')]",
"dependsOn": [
"[resourceId('Microsoft.Web/sites', variables('web-site-name'))]"
],
"properties": {
"siteAuthEnabled": true,
"siteAuthSettings": {
"enabled": true,
"unauthenticatedClientAction": "RedirectToLoginPage",
"tokenStoreEnabled": true,
"defaultProvider": "AzureActiveDirectory",
"clientId": "[parameters('web-aad-client-id')]",
"issuer": "[concat('https://sts.windows.net/', parameters('web-aad-tenant'))]",
"allowedAudiences": [
"[concat('https://', variables('web-site-name'), '.azurewebsites.net')]"
]
}
}
}
Run Code Online (Sandbox Code Playgroud)
问题:
unauthenticatedClientAction 被分配允许匿名而不是 RedirectToLoginPageallowedAudiences 未分配任何站点什么可能导致这些问题?我可能错过了什么?
azure-active-directory azure-resource-manager azure-web-app-service
我正在尝试为具有参数的方法编写单元测试.我的方法特别是我的自定义对象的TryParse方法.我在Visual Studio 2013中使用.NET 4.5/5.这使我可以使用PrivateType对象完全实现私有/内部和静态对象.似乎逃避我的一件事是如何测试out参数,因为我不能在InvokeStatic方法中使用this关键字.我正在寻找适当的解决方案来测试这种架构设计.
TryParse的使用是TypeConverter进程的一部分,如WebAPI参数绑定帖子中所述.作者:Mike Wilson
public class MyFilter
{
public string Field { get; set; }
//... removed for brevity
internal static bool TryParse(string sourceValue, out MyFilter filter)
{
//... removed for brevity
}
}
public class MyFilterTests
{
[TestMethod]
[TestCategory("TryParse")]
public void TryParseWithTitleOnly()
{
var stringSource = "{field:'DATE.FIELD'}";
MyFilter tryParseOut = null;
var target = new PrivateType(typeof(MyFilter));
var tryParseReturn = target.InvokeStatic("TryParse", stringSource, tryParseOut);
var expectedOut = new MyFilter()
{
Field = "DATE.FIELD"
};
Assert.IsTrue((bool)tryParseReturn);
Assert.AreEqual(expectedOut, tryParseOut);
} …Run Code Online (Sandbox Code Playgroud)