我在模板中有一个条件如下:
<ng-container>
<p *ngFor="let seat of InfoDetails?.seatInfo">
<template *ngIf="seat.section">
Section {{seat?.section}} ,
</template>
<template *ngIf="seat.row">
Row {{seat?.row}},
</template>
<template *ngIf="seat.seatNo">
Seat number {{seat?.seatNo}}
</template>
</p>
</ng-container>
Run Code Online (Sandbox Code Playgroud)
我有包含row和的数据集seatNo,但它似乎没有在模板中打印.这是什么问题?
我正在使用angularjs构建一个应用程序,我需要在其中显示一个页面,然后在用户粘贴url时打开一个包含详细信息的模式窗口。
路由器配置如下:
.state('main.legalentitites', {
url: '/products/{productId:string}',
views: {
'content@': {
templateUrl: 'app/views/productdetail.html',
controller: 'productDetailCtrl',
},
},
})
.state('main.products.add', {
url: '/products/{productId:string}/add',
onEnter: function($state, $modal) {
$modal
.open({
templateUrl: 'app/views/productModal.html',
resolve: {},
controller: 'ProductCtrl',
})
.result.then(function(result) {
if (result) {
return $state.transitionTo('main.products')
}
})
},
})
.$urlRouterProvider.otherwise(function($injector, $location) {
var $state = $injector.get('$state')
$state.go('main.home')
})
Run Code Online (Sandbox Code Playgroud)
当我输入url时https://localhost:44821/products/6cbc799a-fdc8-4e4d-ac27-0a5165423641/add,它不会导航到页面,并且模式也不会打开。控制台中也没有错误。它总是转到否则配置的部分。可能是什么问题?
我正面临一个奇怪的问题,有时候我会从sendgrid获取网址
https://开头本地主机:81 /激活username=ats8@test.com&activationToken=EAAAAA
哪个工作正常.但有时我得到的网址编码如下,
" https:// localhost:81/Activation?username = ats8%40test.com&activationToken = EAAAAA "
我的ViewModel如下,
public class Verification
{
[DataType(DataType.EmailAddress)]
public string Username { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
[Required]
[DataType(DataType.Password)]
[Compare("Password")]
public string ConfirmPassword { get; set; }
public string ActivationToken { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
方法如下,
public ActionResult Activation(string username, string activationToken)
{
var model = new Verification
{
Username = username,
ActivationToken = activationToken
};
return View(model);
}
Run Code Online (Sandbox Code Playgroud)
在第二种情况下,activationToken为null.即使url被编码,我如何检测activationToken?
我执行了以下服务,
export class UploadPollingService {
constructor(private http: Http, private appConfig: AppConfigService) { }
checkUploadInfo(term: string, ): Observable<Event[]> {
return this.http
.get(this.appConfig.getAPIUrl() + `/checkStatus?processId=${term}`)
.map(this.extractData)
.catch(this.handleErrors);
}
Run Code Online (Sandbox Code Playgroud)
我在组件内部使用它,我想每1秒调用一次此服务并检查状态,基本上是进行轮询。怎么做?
this.uploadPollingService.checkUploadInfo()
Run Code Online (Sandbox Code Playgroud) 我正在使用以下内容对文档db进行动态查询
var i = saList[index];
engagementFilter.Append($"f.keys.SelectedEngagementId = {i}");
Run Code Online (Sandbox Code Playgroud)
这会产生查询
(f.keys.SelectedEngagementId = f9721f2e-144d-40b9-b530-fcf067cab682或f.keys.SelectedEngagementId = f55dd402-9975-4c55-8486-6cb9c6330a66)
但我需要在guid附近引用,我该怎么做?
(f.keys.SelectedEngagementId ="f9721f2e-144d-40b9-b530-fcf067cab682"或f.keys.SelectedEngagementId ="f55dd402-9975-4c55-8486-6cb9c6330a66")
在我的角度应用程序中,我正在调用服务并获取数据,我需要在获取结果后添加控制台日志.我在哪里可以添加控制台日志?
this.searchTerm.asObservable()
.debounceTime(300)
.distinctUntilChanged()
.switchMap(term => this.doFind(term))
.subscribe(data => this.results = data
, error => {
this.errorMessage = error;
});
Run Code Online (Sandbox Code Playgroud) angular ×3
c# ×2
typescript ×2
angularjs ×1
asp.net-mvc ×1
console ×1
guid ×1
javascript ×1
ng-template ×1
polling ×1
string ×1