gpt4 book ai didi

dart - Angular Dart 给出错误 : The getter 'injector$Injector' isn't defined for the class 'self'

转载 作者:行者123 更新时间:2023-12-03 12:29:39 25 4
gpt4 key购买 nike

我只是想在 Angular Dart 中尝试路由。我在关注这个https://webdev.dartlang.org/angular/guide/router/1指导,但我收到错误。

这一行给出错误 final InjectorFactory injector = self.injector$Injector; 错误是 The getter 'injector$Injector' isn't defined for the class 'self

import 'package:angular/angular.dart';
import 'package:angular_router/angular_router.dart';
import '../src/app_component.template.dart' as ng;

import 'main.template.dart' as self;

const useHashLS = false;
@GenerateInjector(routerProvidersHash)

final InjectorFactory injector = self.injector$Injector;
// The getter 'injector$Injector' isn't defined for the class 'self'

void main() {
runApp(ng.AppComponentNgFactory, createInjector: injector);
}

最佳答案

I was having the same problem, as it complete with no errors, I just added the following on analysis_options.yaml to ignore the error.

analyzer:
errors:
undefined_getter: ignore

通过 https://stackoverflow.com/a/53304768/2997534 回答

关于dart - Angular Dart 给出错误 : The getter 'injector$Injector' isn't defined for the class 'self' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53828243/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com