我试图在我的"Angular 6“页面上创建一个锚点,但当我添加配置时: imports: [RouterModule.forRoot(routes,{'anchorScrolling': 'enabled',})], 它返回一个错误: Unable to assign type '{anchorScrolling: string; scrollPositionRestoration: string; } 'to type' ExtraOptions'. An object literal can only specif
我试着做一些简单的事情,比如让锚链接跳到同一个页面上的链接。令人惊讶的是,只有非常有限的文档,但我发现如下:
@machado评论建议如下似乎是正确的方法:
const routerOptions: ExtraOptions = {
useHash: false,
anchorScrolling: 'enabled',
// ...any other options you'd like to use
};
// Then just import your RouterModule with these options
RouterModule.fo
在用angular + requirejs开发的过程中。我遇到了一个奇怪的问题。
如果我快速刷新页面(如按F5),几次后,我会得到以下错误信息,页面将不再工作,甚至再次刷新页面,除非清除缓存并在新选项卡上打开页面:
Error: $digest already in progress
at Error (<anonymous>)
at beginPhase (http://www.caoglish.info/angular_bug/assets/vendor/angular/angular.js:8495:15)
at Object.Scope.$apply
我使用的是loopback-angular-sdk,在使用updateAttributes函数时出现了一个奇怪的错误:
MyModel.prototype$updateAttributes is not a function
这发生在所有的模特身上。我有点怀疑有依赖关系的问题。
我在我的index.html中包含了角资源‘s,所以这不是问题。
这是我的bower.json:
{
"name": "angular",
"version": "1.0.0",
"dependencies": {
我对angular js在ie 11的工作有问题
TypeError:不允许在严格模式下分配只读属性,在Anonymous function (angular.js:7079:34) at Anonymous function(angular.js:7079:34)、enter code here at nodeLinkFn (angular.js:6677:13) at compositeLinkFn (angular.js:6071:13、publicLinkFn (angular.js:5967:30) at link (angular-route.js:919:7) at bound
好吧,伙计们,很抱歉这个问题,因为我知道在编译的时候已经有几个关于类型记录的问题了,但是我遇到了这个问题的一个味道,我无法将这些点连在一起。
我正在尝试跟踪“英雄之旅”应用程序,并试图用完成它,但是我的hero.service.ts文件输出了这个错误:
error TS2339: Property 'handleError' does not exist on type 'HeroService'
我从这里的其他问题中了解到,这很可能与类型记录的配置有关,但似乎没有一致的原因。
我不太熟悉打字稿(或棱角)的特点,无法自己解决这个问题。
我现在的代码如下所示:
代