我有一个在S3中托管的角度站点,我有一个404路由设置(我使用哈希),如果有人举例
mysite/#/gibberish
Run Code Online (Sandbox Code Playgroud)
去
mysite/#/404
Run Code Online (Sandbox Code Playgroud)
在s3存储桶上,我们有一个重定向规则
mysite/gibberish
Run Code Online (Sandbox Code Playgroud)
去
mysite/404.html
Run Code Online (Sandbox Code Playgroud)
一切都很好
现在我只想添加一个额外的逻辑,如果有人输入
mysite的/客户ID
这是一个404以某种方式将其重定向到角度控制器,所以我可以将此请求发送到右页.
所以,在我的重定向S3规则中,为某些传入请求添加一个reg exp而不是发送它,即发送它即mysite /#/ handlethis
这可能吗 ?
我在forloop中填充下拉列表,并希望根据表达式为每个下拉列表设置默认值.这似乎工作,但我的问题是,当我通过ng-selected设置默认值时,它也会触发不理想的更改事件.
我希望只有在下拉列表实际更改时才会触发更改事件.
<div layout="row" ng-if="layer.Styles && layer.Styles.length > 1">
<md-input-container class="md-icon-float md-block layer-style">
<md-select ng-change="vm.changeLayerStyle(layer,selectedStyle)" ng-model="selectedStyle" ng-model-options="{trackBy: '$value.Name'}" aria-label="Change Layer Style">
<md-option ng-repeat="style in layer.Styles" ng-value="style" ng-selected="style.IsDefault == true">
{{style.DisplayName}}
</md-option>
</md-select>
</md-input-container>
</div>
Run Code Online (Sandbox Code Playgroud)
使用角度材料进行下拉
嘿,我发现了一个奇怪的气质页面随机给我以下错误
XML Parsing Error: no element found Location: http://kj2011/site_2011/nonprofit-database/overview.aspx Line Number 1, Column 1:
这个页面好像2周,但截至昨天我随机得到上述错误.我要删除页面并重新创建错误消失但几小时后会再次出现.我有一些其他模板
即 http://kj2011/site_2011/nonprofit-database/financial.aspx
它具有相同的主文件和用户控件,但从未得到错误只是overview.aspx页面.
有任何想法吗 ?
我遇到了这个用es6创建唯一数组的例子
[ ...new Set(array) ]
Run Code Online (Sandbox Code Playgroud)
这似乎工作正常,直到我尝试使用一组对象,它没有返回唯一的数组.
即
let item = [ ...new Set([{id:123,value:'test'},{id:123,value:'test'}]) ];
Run Code Online (Sandbox Code Playgroud)
这是为什么 ?
目前我正在检索我的结果如下:
public List<claim> GetClaims()
{
return _db.claims.OrderBy(cl => cl.claimId).ToList();
}
Run Code Online (Sandbox Code Playgroud)
但是现在我想在listview上面添加基于过滤器的8个条件where子句.
所以我变成了:
public List<claim> GetFilteredClaims(string submissionId, string claimId,
string organization, string status,
string filterFromDate, string filterToDate,
string region, string approver)
{
return _db.claims.Where(cl => cl.submissionId == 5).ToList();
}
Run Code Online (Sandbox Code Playgroud)
如何检查每个过滤器以仅在包含值时添加where子句?
这是我当前为表单设置的验证
<ng-messages for="searchForm.$error" ng-if="searchForm.$submitted">
<ng-message when="required" class="error-message">This search field is required.</ng-message>
</ng-messages>
Run Code Online (Sandbox Code Playgroud)
和我的形式
<form role="form" ng-submit="searchForm.$valid && searchcode()" name="searchForm" novalidate>
Run Code Online (Sandbox Code Playgroud)
它工作正常.
但这是我不喜欢这种情况
1)在空搜索框上按Enter键 - >显示正确的消息"字段是必需的"
2)开始键入和删除文本而不按Enter键 - >它再次显示错误信息
这是我不想要的第二个场景......任何想法?
所以我正在使用grunt编写一个jquery插件,在我的插件中我还需要调用webservices.
webservice url域将始终与用户需要为我们的插件添加的.js文件的位置相同.所以即相对
1)包含插件的JS文件
2)在我的JS调用API URL中
需要是
api_domain: "http://mydomain1/api/v1"
Run Code Online (Sandbox Code Playgroud)
我希望api域相对于我试过的调用它的JS文件的域
api_domain: "/mydomain1/api/v1"
Run Code Online (Sandbox Code Playgroud)
但这会占用浏览器的域名.
所以我想知道实现这一目标的最佳方法是什么
1)使用.NET处理程序从context.request.url插入正确的域名
2)在Grunt构建中为我将部署的每个环境创建一个特定的.js,其中包含JS中的完整URL
3)其他选择?
只是与我的webpack混淆,并设置了最好的方法,在我的CSS中包含图像的URL,让他们在开发和构建模式下工作.
以下使用webpack-devserver在dev中工作,但在构建之后没有.
.login-container{
height:100%;
width:100%;
background: url('../../images/home3.jpg') no-repeat center center fixed;
Run Code Online (Sandbox Code Playgroud)
在我的配置中.
plugins.push(
new HtmlWebpackPlugin({
template: './src/index.html',
inject: 'body'
}),
// Write out CSS bundle to its own file:
new ExtractTextPlugin({
filename: 'css/styles.css',
allChunks: true})
);
Run Code Online (Sandbox Code Playgroud)
也
entry: {
app: './src/app/app.js'
},
devServer: {
outputPath: path.join(__dirname, 'src'),
contentBase: "./src"
},
output: {
path: path.resolve(__dirname, 'dist'),
publicPath: isProd ? '' : 'http://localhost:8080/',
filename: isProd ? 'js/[name].[hash].js' : 'js/[name].bundle.js',
chunkFilename: isProd ? 'js/[name].[hash].js' : 'js/[name].bundle.js'
},
Run Code Online (Sandbox Code Playgroud)
在开发中它工作正常但是在构建之后它试图从我的css文件夹加载图像
即mysites/css/12424324234234234.jpg
代替
即mysites/12424324234234234.jpg图像真的在哪里.
所以在Angular Material 2中,我设置了主题
$store-primary: mat-palette($mat-storecast);
$store-accent: mat-palette($mat-pink, A200, A100, A400);
// The warn palette is optional (defaults to red).
$store-warn: mat-palette($mat-red);
// Create the theme object (a Sass map containing all of the palettes).
$store-theme: mat-light-theme($store-primary, $store-accent, $store-warn);
// Include theme styles for core and each component used in your app.
// Alternatively, you can import and @include the theme mixins for each component
// that you are using.
@include angular-material-theme($store-theme);
Run Code Online (Sandbox Code Playgroud)
我从他们的文档中无法弄清楚的是如何从主调色板上获得不同的色调颜色,即按钮上的工具栏.
<button md-mini-fab (click)="zoomIn()" color="primary">
<md-icon>add</md-icon>
</button>
Run Code Online (Sandbox Code Playgroud)
它似乎只能理解color = …
嘿,我收到以下错误
分析程序错误说明:解析为此请求提供服务所需的资源时发生错误.请查看以下特定的解析错误详细信息并相应地修改源文件.
分析器错误消息:无法加载类型'_AddToCart'.
来源错误:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" Codebehind="AddToCart.aspx.cs" Inherits="_AddToCart" Title="Untitled Page" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: /FSAICart/AddToCart.aspx Line: 1
Run Code Online (Sandbox Code Playgroud)
我在哪里有匹配的代码隐藏文件,定义如下
using System;
public partial class _AddToCart : System.Web.UI.Page {
Run Code Online (Sandbox Code Playgroud)
有任何想法吗 ?