如何A从服务器加载服务器上的惰性模块(loadchildren)B?我从谷歌搜索了几个链接,但是,我无法通过示例找到正确的答案。
当我的模块位于某些 CDN 上时,我发现如何在我的路由中加载儿童, 这可能与我的问题类似,但我不理解它的示例,而且答案对我来说似乎不完整。
我的问题是:
loadchildren吗?platformBrowserDynamic().bootstrapModule(FirstLazyModule )在惰性模块中?我的要求是使用 webpack/angular 制作一组惰性模块并将其托管到服务器,B而主引导模块托管在服务器上A,我可以在运行时提供指向Routes主(引导程序)模块属性的惰性模块链接loadchildren。
注意:我不想用惰性模块和主机块编译整个项目到不同的服务器。
例子
不了解惰性模块但仅 CDN 链接的应用程序路由。
// http links to load lazy modules from server B
const m1Link = 'http link of M1 which hosted on server B'
const m2Link = 'http link of M2 which hosted on server B'
const route:Routes = [
{ path:'M1', loadchildren: …Run Code Online (Sandbox Code Playgroud) 我有一个带有节点组的深度嵌套数组,我想创建类似的查询字符串
(FULL_NAME="x" AND NOT(AGE="30" OR AGE="40" AND (ADDRESS="y" AND STREET="z" AND NOT(USER="admin" OR USER="super admin"))) AND TITLE="Developer")
Run Code Online (Sandbox Code Playgroud)
我拥有的json数据是,
NOT (X="y" AND Y="x")NOT操作符,这个容器就变成一个组,里面会有另一个容器,有AND或ORNOT,之间进行选择AND,OR但如果他们尝试将它们分组,则不能具有相同的运算符,这仅适用于NOT运算符。我的数组看起来像:
[
{
"uuid":"b7f0ddf4-0290-4c7e-bb59-771aa46bc850",
"operator":"AND",
"isMain":true,
"nodes":[
{
"values":{
"fieldValue":{
"FieldName":"ORIGINAL_FILE_NAME",
},
"operator":"=",
"primaryOperandValue":"new"
},
"uuid":"779fb920-eb7f-4441-9b5a-886c7a41e271"
}
],
"children":[
{
"uuid":"7467b8c9-212e-41b8-ac02-04296b95c88c",
"operator":"NOT",
"nodes":[],
"children":[
{
"operator":"AND",
"uuid":"eaad7c96-0e8f-466b-a255-1075a8e68647",
"nodes":[
{
"uuid":"f6057d1b-56d7-4ee6-ac5b-332fbd180fd4",
"values":{
"fieldValue":{
"FieldName":"CONTROL_NUMBER",
},
"operator":"BETWEEN",
"primaryOperandValue":"x",
"secondaryOperandValue":"y"
}
} …Run Code Online (Sandbox Code Playgroud) 我试图将源字符串映射到List<T>for member,但映射的成员列表属性的值始终为 null。
这是我的代码。
//Source model
public class Claims
{
public int Id { get; set; }
public string ClaimType {get; set; }
public string ClaimValue { get; set; } // produce json string [{"Action":"read","Status":"active"}]
}
// Dest model
public class ClaimsDto
{
public int Id { get; set; }
public string ClaimType { get; set; }
public List<ResourceActions> ClaimValues { get; set; }
}
public class ResourceActions
{
public string Action { get; set; }
public string …Run Code Online (Sandbox Code Playgroud) 我收到了这个警告
(node:4692)DeprecationWarning:
Chunk.modules已弃用.请Chunk.getNumberOfModules/mapModules/forEachModule/containsModule改用
升级后webpack v2.6.1到v3.在v2xx,工作正常,但v3给我这个错误.
我不知道哪个包导致了这个问题.任何参考或链接可能会有所帮助.
我的package.json文件:
{
"name": "app",
"version": "1.0.0",
"description": "app",
"scripts": {
"start": "webpack-dev-server --hot --inline --progress --colors --port 2000"
},
"license": "MIT",
"dependencies": {
"@angular/animations": "~4.2.4",
"@angular/common": "~4.2.4",
"@angular/compiler": "~4.2.4",
"@angular/core": "~4.2.4",
"@angular/forms": "~4.2.4",
"@angular/http": "~4.2.4",
"@angular/material": "~2.0.0-beta.7",
"@angular/platform-browser": "~4.2.4",
"@angular/platform-browser-dynamic": "~4.2.4",
"@angular/router": "~4.2.4",
"core-js": "~2.4.1",
"hammerjs": "~2.0.8",
"rxjs": "~5.4.1",
"zone.js": "~0.8.12"
},
"devDependencies": {
"@angular/compiler-cli": "~4.2.4",
"@angular/platform-server": "~4.2.4",
"@ngtools/webpack": "~1.4.1",
"@types/jquery": …Run Code Online (Sandbox Code Playgroud) 如何在 中添加多个 cookie 方案aspnet core 2.0?
我已按照此处的Auth 2.0 迁移公告 和此处的将身份验证和身份迁移到 ASP.NET Core 2.0 中的说明进行操作, 但我无法添加多个方案。
例如:
services.AddAuthentication("myscheme1").AddCookie(o =>{
o.ExpireTimeSpan = TimeSpan.FromHours(1);
o.LoginPath = new PathString("/forUser");
o.Cookie.Name = "token1";
o.SlidingExpiration = true;
});
services.AddAuthentication("myscheme2").AddCookie(o =>{
o.ExpireTimeSpan = TimeSpan.FromHours(1);
o.LoginPath = new PathString("/forAdmin");
o.Cookie.Name = "token2";
o.SlidingExpiration = true;
});
Run Code Online (Sandbox Code Playgroud) angular ×3
javascript ×3
asp.net-core ×2
c# ×2
typescript ×2
webpack ×2
asp.net ×1
asp.net-mvc ×1
automapper ×1
cookies ×1
json ×1
node.js ×1
npm ×1