我需要有三个状态滑块:
关闭:X--o--o
未知: o--X--o
上: o--o--X
但我认为 Angular-Material 的默认滑动切换不支持它: https: //material.angular.io/components/slide-toggle/overview
有没有办法扩展这个控件的功能?或者如果没有的话我应该怎么做才能将其用作起点?
我有一个 Angular 12 应用程序,我正在尝试将其升级到 Angular 13。
\n根据https://update.angular.io/?l=2&v=12.0-13.0我应该运行:
\nnpx @angular/cli@13 update @angular/core@13 @angular/cli@13\nRun Code Online (Sandbox Code Playgroud)\n但是当我这样做时,我收到以下错误:
\nnpx @angular/cli@13 update @angular/core@13 @angular/cli@13\nThe installed local Angular CLI version is older than the latest stable version.\nInstalling a temporary version to perform the update.\n\xe2\x9c\x94 Package successfully installed.\nUsing package manager: \'npm\'\nCollecting installed dependencies...\nFound 38 dependencies.\nFetching dependency metadata from registry...\n Updating package.json with dependency @angular-devkit/build-angular @ "13.0.2" (was "12.1.1")...\n Updating package.json with dependency @angular/cli @ "13.0.2" (was "12.1.1")...\n Updating package.json with dependency @angular/compiler-cli …Run Code Online (Sandbox Code Playgroud) 我们有一个 PR 由于我们的测试集而失败了。他们仅因此 PR 而失败,并出现以下错误:
The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
Run Code Online (Sandbox Code Playgroud)
它总是因这个错误而崩溃,而其他分支工作正常。总是相同的例外,但并非每次都在同一位置。我们尝试启用诊断,但它绝对没有提供任何附加信息:
##[debug]ProxyRunRequest: HandleLogMessage Entered
##[error]RunMessage : The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
##[debug]Processed: ##vso[task.logissue type=error;]RunMessage : The active test run was aborted. Reason: Test host process crashed : Unhandled Exception: System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain.
Run Code Online (Sandbox Code Playgroud)
我们使用Nunit,我们的YML的测试部分如下:
- …Run Code Online (Sandbox Code Playgroud) 我正在设置一个 C# Asp.Net Core Api,它将在未来大幅增长。因此,我试图尊重干净代码架构,以我的域为中心,没有任何依赖性和周围的一切:
public abstract class Entity
{
public Guid Id { get; set; }
}
Run Code Online (Sandbox Code Playgroud)
我目前正在实施存储库。我的问题是,对于 mongoDb,似乎必须提供属性[BsonId],或者在我的实体中使用 BsonId。但这意味着在我的实体项目中添加 mongoDb 引用,我不是它的忠实粉丝。
public interface IRepository<TDocument> where TDocument : Entity
{
IQueryable<TDocument> AsQueryable();
IEnumerable<TDocument> FilterBy(
Expression<Func<TDocument, bool>> filterExpression);
IEnumerable<TProjected> FilterBy<TProjected>(
Expression<Func<TDocument, bool>> filterExpression,
Expression<Func<TDocument, TProjected>> projectionExpression);
Task<TDocument> FindOne(Expression<Func<TDocument, bool>> filterExpression);
Task<TDocument> FindById(Guid id);
Task InsertOne(TDocument document);
Task InsertMany(ICollection<TDocument> documents);
Task ReplaceOne(TDocument document);
Task DeleteOne(Expression<Func<TDocument, bool>> filterExpression);
Task DeleteById(Guid id);
Task DeleteMany(Expression<Func<TDocument, bool>> filterExpression);
}
Run Code Online (Sandbox Code Playgroud)
在我在 Clean Architecture 上找到的示例中,他们大多使用实体框架,不需要绝对属性即可工作。 …
我目前正在尝试强制我或我的同事无法在我的角度应用程序中提交包含 console.log 的文件。
我目前已经进行了husky预提交,执行ng lint --fix.
有没有办法在我的 linting 中添加一些内容以防止控制台日志,或者在 husky 脚本中添加一些内容?
人们仍然应该能够使用 console.log,只是不提交它。
谢谢
我正在实现一个身份验证存储(带有 firebase),并根据身份验证将我的用户路由到登录/记录页面。
但在打字稿中。
在我的 中main.ts,我确实将商店声明为财产:
const app = createApp(App);
const pinia = createPinia();
pinia.use(({ store }) => {
store.router = markRaw(router);
});
app.use(pinia);
app.use(router);
app.mount('#app');
Run Code Online (Sandbox Code Playgroud)
但是,在我的商店中,它仍然不知道我有一个路由器属性:
export const useStoreAuth = defineStore('storeAuth', {
state: () => {
return {
user: {},
} as AuthState;
},
actions: {
init() {
onAuthStateChanged(auth, user => {
if (user && user.uid && user.email) {
this.user = { id: user.uid, email: user.email };
this.router.push('/'); //--> router doesn't exists
} else {
this.user …Run Code Online (Sandbox Code Playgroud) 我有一个在客户端和服务器端使用WCF的应用程序。返回大量数据时出现错误:
尝试序列化参数http://tempuri.org/:GetCurrentDatabaseObjectsResult时发生错误。InnerException消息是“在对象图中可以序列化或反序列化的最大项目数为'65535'。更改对象图或增加MaxItemsInObjectGraph配额。'。有关更多详细信息,请参见InnerException。
(最重要的是我必须增加MaxItemsInObjectGraph)。
我在这里找到了这篇文章:如何从Silverlight应用程序中以编程方式设置maxItemsInObjectGraph属性?但似乎这仅适用于客户端,我需要在服务器上执行此操作。
我必须从我的C#程序访问另一个开发人员的一些MySql视图.
所以在经过一些搜索之后我决定实体框架,并使用这个问题中提到的驱动程序:使用MySQL和Entity Framework(MySQL .NET Connector).
现在,我正在尝试获取一个视图的第一个元素:
myEntities.events.First();
Run Code Online (Sandbox Code Playgroud)
在那里,我得到一个例外:
System.Data.EntityCommandExecutionException was unhandled
Message=An error occurred while executing the command definition. See the inner exception for details.
Source=System.Data.Entity
StackTrace:
at System.Data.EntityClient.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
at System.Data.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at System.Data.Objects.ELinq.ObjectQueryProvider.<GetElementFunction>b__0[TResult](IEnumerable`1 sequence)
at System.Data.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot)
at System.Data.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[S](Expression expression)
at System.Linq.Queryable.First[TSource](IQueryable`1 source)
at J4N.GroopleReports.ReportManager.DataImporter.GenerateEvent(GroopleEntities groopleEntities) in C:\Users\J4N\Dropbox\WorkSpaces\DotNET\GroopleReports\ReportManager\DataImporter.cs:line 35
at J4N.GroopleReports.ReportManager.DataImporter.Import() in C:\Users\J4N\Dropbox\WorkSpaces\DotNET\GroopleReports\ReportManager\DataImporter.cs:line 17
at ImportTest.Program.Main(String[] args) in C:\Users\J4N\Dropbox\WorkSpaces\DotNET\GroopleReports\ImportTest\Program.cs:line 15 …Run Code Online (Sandbox Code Playgroud) 我正在使用ASP.NET MVC 3的库(Telerik).
我的所有功能都有问题,需要通过AJAX返回一些数据:
我正在使用EF4来连接我的数据库,而且我(并且需要)两种方式的导航属性(想象一下,有一些帖子和一个帖子的用户都有用户).
问题是该库正在使用JavaScriptSerializer,它使用JSON对数据进行编码.
我得到的错误
序列化"System.Data.Entity.DynamicProxies.Employee_34048F4F6A98297F826C798A27640C7383E95E8EA8282EC8A5F738FA0C77CBC3"类型的对象时检测到循环引用."
异常,这是正确的,因为父级引用了它的子级,而子级引用了它的父级.
我已经找到了一些解决方法,但没有什么能完全满足我:
我和WCF几乎有同样的问题,我创建了一个知道处理循环引用的序列化,我们可以在这里做同样的事吗?或者有办法管理这个吗?
如果没有,我想最好的方法是使用"ViewModel",但有没有办法加速这些创作?像一个泛型对象,它接受构造函数EF对象并删除循环引用?还要别的吗?
非常感谢你
.net serialization entity-framework circular-reference javascriptserializer
我正在使用ASP.Net MVC 3启动一个简单的Web应用程序.
我做了几页,主要用于身份验证,它使用自定义提供程序和asp表单身份验证.
在我的Visual Studio本地服务器上,它运行良好,当我进入带有[Authorize]属性的页面时,我被重定向到我的登录页面,在我登录后,我可以毫无问题地访问此页面.
我通过FTP在我的网站上发布了一个专用服务器(在我的局域网上),现在,当我访问网站时,我正确地重定向到登录页面,但是没有获得登录页面,我获得了401 Unauthorized异常.
编辑:澄清,我的登录页面是/ Account/Auth/Login,如果我尝试访问任何东西(例如/ OtherArea/OtherController/OtherAction,我被重定向到/ Account/Auth/Login,但它显示错误401)
如果我在服务器上本地或从我的桌面尝试它,这也是同样的问题.
我有相同的web.config文件,没有启用其他身份验证模式,我的应用程序池的用户可以完全控制该目录.什么可能出错?
我启用了详细错误,我得到的唯一细节是:
由于身份验证标头无效,您无权查看此页面.
除了asp.net 4 +发布之外还有一些先决条件要安装吗?发布是否复制了asp.net所需的所有dll?