gpt4 book ai didi

angular - Angular 2 + Dart依赖项:URI的目标不存在: 'package:http/browser_client.dart';

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

这可能是一个新手问题,但我找不到问题:我正在尝试使用Angular 2 + Dart创建一个应用程序。这是我的/pubspec.yaml文件:

name: ad_checkout
description: A Dart app that uses Angular 2
version: 0.0.1
environment:
sdk: '>=1.19.0 <2.0.0'
dependencies:
angular2: ^2.0.0
dev_dependencies:
browser: ^0.10.0
dart_to_js_script_rewriter: ^1.0.1
transformers:
- angular2:
platform_directives:
- 'package:angular2/common.dart#COMMON_DIRECTIVES'
platform_pipes:
- 'package:angular2/common.dart#COMMON_PIPES'
entry_points: web/main.dart
resolved_identifiers:
BrowserClient: 'package:http/browser_client.dart'
Client: 'package:http/http.dart'
- dart_to_js_script_rewriter

我正在使用IntelliJ IDEA,并尝试按照本教程启用ajax调用: https://angular.io/docs/dart/latest/tutorial/toh-pt6.html

这是我的web / main.dart文件:
import 'package:angular2/platform/browser.dart';
import 'package:http/browser_client.dart';

import 'package:ad_checkout/app_component.dart';

void main() {
bootstrap(AppComponent,[
provide(BrowserClient, useFactory: () => new BrowserClient(), deps: [])
]);
}

在IntelliJ中,我尝试“获取依赖项”,“更新依赖项”和“清除缓存”没有任何帮助。我想念什么?

最佳答案

您没有在httpdependencies:部分下列出的pubspec.yaml

http: ^0.11.3中的angular2下添加dependencies:

关于angular - Angular 2 + Dart依赖项:URI的目标不存在: 'package:http/browser_client.dart';,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40554555/

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