Having trouble setting up jest projects. Project A has some additional configuration that it runs (setupJest, creates some custom matchers, etc) that project B does not have. When I run jest I get this error for every single test it tries to run:
Test suite failed to run
File not found: <rootDir>/src/tsconfig.spec.json (resolved as: repo\src\tsconfig.spec.json)
Run Code Online (Sandbox Code Playgroud)
There is no src folder in the repo root, only inside the individual project folders. I'm also not referencing src\tsconfig.spec.json anywhere in my setups. So …
为公司网站制作一个有角度的入职页面。人们将通过欢迎电子邮件中的链接导航到页面,该电子邮件将包含用户特定的令牌。我需要从url查询字符串中获取此令牌,并将其用于身份验证的所有ajax调用中。我的问题是读取查询字符串。
角版本为4.2.4
我已经通过对文档的页面梳理“@角/通用”位置,LocationStrategy,PathLocationStrategy并复制粘贴的进口,并将它们添加到供应商,我得到错误错误后错误之后。我找不到在任何位置导入位置并使用它来从页面url获取查询字符串的简单示例。如果这是javascript,那是几行简单的代码。为什么这么难?任何帮助将不胜感激!
我试过的
app.module.ts
import { Location, LocationStrategy, PathLocationStrategy } from '@angular/common';
providers: [Location, {provide: LocationStrategy, useClass: PathLocationStrategy}],
Run Code Online (Sandbox Code Playgroud)
page.services.ts
constructor(private location: Location) {
console.log('location: ', location);
}
Run Code Online (Sandbox Code Playgroud)