我正在构建一个垂直滚动的日历。我正在加载最初的日子,但是当新的日子添加到列表中时,它们不会被呈现。
<cdk-virtual-scroll-viewport
class="demo-viewport"
[itemSize]="100"
(onContentScrolled)="handleScrollChange($event)"
>
<calendar-day
*cdkVirtualFor="let day of days; trackBy: trackByFn"
[day]="day"
></calendar-day>
</cdk-virtual-scroll-viewport>
<button (click)="goToToday()">go</button>
Run Code Online (Sandbox Code Playgroud)
我有一项BehaviorSubject更新天数的服务。我知道天数列表正在更新,但似乎没有检测到更改。
ngOnInit() {
this._daysService.days$.subscribe(days => {
this.days = days;
})
this.watchScroll();
this.handleScrollingUp();
this.handleScrollingDown();
}
Run Code Online (Sandbox Code Playgroud)
有关更多信息,StackBlitz 存储库是公开的https://stackblitz.com/edit/material-infinite-calendar
我正在尝试为这种方法编写一些单元测试,但我无法弄清楚如何设置Request.具体来说,我需要设置Query和头属性Referer.
public IActionResult Index()
{
if (User.Identity.IsAuthenticated)
{
return RedirectToAction("Index", "Home");
}
var query = Request.Query;
StringValues returnUrlValue;
if (query.TryGetValue("returnUrl", out returnUrlValue))
{
var returnUrl = returnUrlValue.ToString();
var referer = Request.Headers["Referer"].ToString();
if (string.IsNullOrEmpty(returnUrl) && !string.IsNullOrEmpty(referer))
{
returnUrl = WebUtility.UrlEncode(referer);
}
if (Url.IsLocalUrl(returnUrl) && !string.IsNullOrEmpty(returnUrl))
{
ViewBag.ReturnUrl = returnUrl;
}
}
return View();
}
Run Code Online (Sandbox Code Playgroud)
我知道在request进入控制器之前经过中间件,所以它不能作为参数传递给控制器.但是,Request控制器上的对象是readonly,也不能分配.因此,类似下面的内容将无法正常工作.
var controller = new LoginController();
controller.Request = new DefaultHttpRequest(new DefaultHttpContext())
{
QueryString = new …Run Code Online (Sandbox Code Playgroud) 我正在将.net 4.7 MVC项目转换为.net core 2,尽可能地保留尽可能多的代码.这个项目有一个BaseService是建立一个AuthCookie多数民众赞成在整个应用一些其他服务消费.
// Create
public HttpCookie AuthCookie { get; set; } = new HttpCookie(AuthUtils.CookieName);
// Consume
if (AuthCookie?.Value != null) { ... }
Run Code Online (Sandbox Code Playgroud)
在.net 4.7中,HttpCookie该类包含在System.Web命名空间中,但似乎并未以相同的方式存在于.net core 2中.在中,cookie是在控制器的上下文之外构建和处理的.
我见过: 为什么我不能使用HttpContext或HttpCookie?(Asp.Net Core 1.0)
这似乎没有解决这个问题..net核心中的身份验证处理的根本区别是如此之大以至于无法处理此案例?
搞乱这个有一段时间了,但无法解决。我正在尝试为该 JSON 中的每个路径创建数组。
[
{
"WebApp : calendar": {
"count": 3151,
"next": {
"ViewWorkout": {
"count": 521,
"next": {
"BeginUserSession": {
"count": 12,
"next": {}
},
"EditWorkout": {
"count": 134,
"next": {}
},
"WebApp : expandoOpened": {
"count": 116,
"next": {}
},
"Mobile : Feed": {
"count": 2,
"next": {}
},
"WebApp : athleteLoadedFromLibrary": {
"count": 45,
"next": {}
},
"ViewWorkout": {
"count": 108,
"next": {}
},
"WebApp : workoutQuickViewTabmapGraphClicked": {
"count": 18,
"next": {}
},
"DeleteWorkout": {
"count": 9, …Run Code Online (Sandbox Code Playgroud) 我正在努力让我的React/Redux应用程序根据操作更新URL.我做了很多环顾四周.我以为我有一个处理它,但显然我错过了一些东西.我还有其他正确响应的减速器.
目前,我只是想记录行动.
路由减速器
const initialState = { locationBeforeTransitions: null };
export default function routing(state = initialState, action)
{
switch (action.type)
{
case 'LOCATION_CHANGE':
console.log(action)
default:
return state
}
}
Run Code Online (Sandbox Code Playgroud)
商店
/*
Things from other people
*/
import { createStore, applyMiddleware, compose } from 'redux'
import { syncHistoryWithStore } from 'react-router-redux';
import { browserHistory } from 'react-router'
import thunkMiddleware from 'redux-thunk'
import createLogger from 'redux-logger'
/*
Things from us
*/
import { fetchSuitesAndFails, fetchResults } from './actions/actions';
import rootReducer from './reducers/index' …Run Code Online (Sandbox Code Playgroud) 第一次与Wercker和我一起使用internal/docker-push.当我运行部署步骤时,我从docker-hub收到404错误.
ERROR Error interacting with this repository: wluce/statler-waldorf-corp-team-service PUT https://registry.hub.docker.com/v1/repositories/wluce/statler-waldorf-corp-team-service/ returned 404
Run Code Online (Sandbox Code Playgroud)
这不是我第一次运行这一步并且之前有效.图像存在并且在这里.
我无法弄清楚什么可以改变.
这是wercker.yml我用来执行构建和部署的文件.
box: microsoft/dotnet:2.0.0-sdk-2.0.2
no-response-timeout: 10
build:
steps:
- script:
name: restore
cwd: src/StatlerWaldorfCorp.TeamService
code: dotnet restore
- script:
name: build
cwd: src/StatlerWaldorfCorp.TeamService
code: dotnet build
- script:
name: test-restore
cwd: test/StatlerWaldorfCorp.TeamService.Tests
code: dotnet restore
- script:
name: test-build
cwd: test/StatlerWaldorfCorp.TeamService.Tests
code: dotnet build
- script:
name: test-run
cwd: test/StatlerWaldorfCorp.TeamService.Tests
code: dotnet test
- script:
name: integration-test-restore
cwd: test/StatlerWaldorfCorp.TeamService.Tests.Integration
code: dotnet …Run Code Online (Sandbox Code Playgroud) 我知道这里有一个简单的解决方案,但我尝试浏览了一些教程,但未能将它们应用于我的代码。我通过area为 3-5 个数据点的每段单独绘制一个高程图。所以,我有很多情节发生在同一张图上。因此,我尝试了缩放svg元素的缩放技术,但一直是空的。这是我最近的尝试。希望大家能帮帮忙。
目前,当我尝试缩放时,它会将 x 和 y 比例重置为 [0,1] 并用填充颜色填充整个区域。
这是一个Plunk
// ***************************** //
// Set Up //
// ***************************** //
// *** MAP VARIABLES ***
L.mapbox.accessToken = 'pk.eyJ1Ijoid2lsbGlhbWx1Y2UiLCJhIjoiNE1zU0xMNCJ9.X9y-S0ubezlH-aefwUZslA';
var map = L.mapbox.map('map', 'examples.map-i86nkdio')
// *** CHART VARIABLES ***
var margin = {top: 10, right: 20, bottom: 30, left: 100},
width = 1100 - margin.left - margin.right,
height = 150 - margin.top - margin.bottom;
// Map colors to limits
var color = d3.scale.ordinal()
.domain([-10,-5,0,5,10])
.range(['#a1d99b','#c7e9c0','#fdd0a2','#fdae6b','#fd8d3c','#e6550d']); …Run Code Online (Sandbox Code Playgroud) javascript ×3
c# ×2
d3.js ×2
angular ×1
asp.net-core ×1
docker ×1
dockerhub ×1
json ×1
react-router ×1
reactjs ×1
redux ×1
svg ×1
typescript ×1
unit-testing ×1
wercker ×1
xunit ×1
zooming ×1