gpt4 book ai didi

dart - 用Angular Dart和Polymer Dart设计 Material 。编译问题

转载 作者:行者123 更新时间:2023-12-03 03:18:53 27 4
gpt4 key购买 nike

我在这里结束。在过去的48小时中,我一直在努力使这些技术起作用。我到处都读到它们应该能够起作用,但这只是一个接一个的问题。我已经尝试过pubspeck.yaml文件的各种组合,但是得到的结果要么是根本无法构建代码,要么就是无法正常工作。

我将不胜感激!

我的pubspeck.yaml:

name: blah
dependencies:
angular: 0.12.0
angular_node_bind: any
shadow_dom: any
browser: any
polymer: ">=0.11.0 <0.12.0"
core_elements: ">=0.0.6 <0.1.0"
paper_elements: any
transformers:
- angular
- polymer:
entry_points:
- web/index.html
dependency_overrides:
polymer: ">= 0.11.1-dev < 0.12.0"
browser: any
web_components: 0.4.0
analyzer: ">=0.15.6 <0.16.0"
html5lib: ">=0.11.0 <0.12.0"

我的 Dart 文件:

import 'package:polymer/polymer.dart';
import 'package:angular/angular.dart';
import 'package:angular/application_factory.dart';
import 'package:angular_node_bind/angular_node_bind.dart';

// HACK until we fix code gen size. This doesn't really fix it,
// just makes it better.
@MirrorsUsed(override: '*')
import 'dart:mirrors';

void main() {
initPolymer().run(() {
applicationFactory().addModule(new AppModule()).addMdoule(new NodeBindModule()).run();
});
}

最后是我的html:

<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>GTHR</title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">

<link href="css/screen.css" media="screen, projection" rel="stylesheet" type="text/css" />

<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>

<!-- <script src="packages/web_components/platform.js"></script>
not necessary anymore with Polymer >= 0.14.0 -->
<script src="packages/web_components/dart_support.js"></script>

<link rel="import" href="packages/paper_elements/paper_tabs.html">
<link rel="import" href="packages/paper_elements/paper_tab.html">
<link rel="import" href="packages/core_elements/core_header_panel.html">
<link rel="import" href="packages/core_elements/core_toolbar.html">
<script type="application/dart" src="Application.dart"></script>
<script src="packages/browser/dart.js"></script>
</head>
<body fullbleed layout vertical>
<!--[if lt IE 7]>
<p class="browsehappy">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<![endif]-->

<core-header-panel mode="waterfall">
<div class="core-header">
My App
</div>
<div>
<core-toolbar>
<paper-tabs selected="0" role="tablist">
<paper-tab>World</paper-tab>
<paper-tab>Followers</paper-tab>
<paper-tab>Mine</paper-tab>
</paper-tabs>
</core-toolbar>
</div>
</core-header-panel>

<div class="main-container">
<div class="main wrapper clearfix">
</div> <!-- #main -->
</div> <!-- #main-container -->

<div class="footer-container">
<footer class="wrapper">
<h3>footer</h3>
</footer>
</div>

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.0.min.js"><\/script>')</script>

<!-- Latest compiled and minified JavaScript -->
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
<script src="packages/shadow_dom/shadow_dom.debug.js"></script>

<script src="js/flowtype.js"></script>
<script src="js/main.js"></script>

<!-- Google Analytics: change UA-XXXXX-X to be your site's ID. -->
<script>
(function(b,o,i,l,e,r){b.GoogleAnalyticsObject=l;b[l]||(b[l]=
function(){(b[l].q=b[l].q||[]).push(arguments)});b[l].l=+new Date;
e=o.createElement(i);r=o.getElementsByTagName(i)[0];
e.src='http://www.google-analytics.com/analytics.js';
r.parentNode.insertBefore(e,r)}(window,document,'script','ga'));
ga('create','UA-XXXXX-X');ga('send','pageview');
</script>
</body>
</html>

使用我的以下代码,Dart2js给了我以下输出:

使用pubspeck.yaml,我得到以下输出:

Loading source assets... 
Loading smoke/src/default_transformer transformers...
Loading di transformers... (1.7s)
Loading observe transformers...
Loading angular transformers...
Loading polymer/src/build/mirrors_remover transformers...
Loading polymer transformers...
Loading polymer transformers...
Loading polymer transformers... (1.0s)
Building gthr-web... (14.1s)
[Info from Dart2JS]:
Compiling gthr-web|web/Application_static_expressions.dart...
[Error from Dart2JS]:
web/Application_static_expressions.dart:1:13:
Expected ';', but got '-'.
library gthr-web.web.Application.generated_expressions;
^
[Info from Dart2JS]:
Took 0:00:00.519007 to compile gthr-web|web/Application_static_expressions.dart.
[Info from Dart2JS]:
Compiling gthr-web|web/Application.dart...
[Error from Dart2JS on gthr-web|web/Application.dart]:
web/Application_static_expressions.dart:1:13:
Expected ';', but got '-'.
library gthr-web.web.Application.generated_expressions;
^
[Info from Dart2JS]:
Took 0:00:00.591015 to compile gthr-web|web/Application.dart.
[Info from Dart2JS]:
Compiling gthr-web|web/Application_static_injector.dart...
[Error from Dart2JS]:
web/Application_static_injector.dart:1:13:
Expected ';', but got '-'.
library gthr-web.web.Application.generated_static_injector;
^
[Info from Dart2JS]:
Took 0:00:00.501912 to compile gthr-web|web/Application_static_injector.dart.
[Info from Dart2JS]:
Compiling gthr-web|web/Application_static_metadata.dart...
[Error from Dart2JS]:
web/Application_static_metadata.dart:1:13:
Expected ';', but got '-'.
library gthr-web.web.Application.generated_metadata;
^
[Info from Dart2JS]:
Took 0:00:00.151240 to compile gthr-web|web/Application_static_metadata.dart.
[Info from Dart2JS]:
Compiling gthr-web|web/index.html_bootstrap.dart...
[Error from Dart2JS on gthr-web|web/index.html_bootstrap.dart]:
web/Application_static_expressions.dart:1:13:
Expected ';', but got '-'.
library gthr-web.web.Application.generated_expressions;
^
[Info from Dart2JS]:
Took 0:00:00.916099 to compile gthr-web|web/index.html_bootstrap.dart.
Build failed.

最佳答案

我刚刚开始查看您的代码(也许我找到了更多的提示/建议/问题)

你应该尝试改变

polymer: ">=0.11.1-dev <0.12.0"


polymer: ">=0.12.0-dev <0.12.0"

Polymer程序包的此预发行版本包含一些与纸张元素相关的错误修复。

似乎您在此字符无效的库标识符中使用了 -(破折号)。您也不应在Dart文件名和所有小写字符中使用破折号。

编辑
软件包 shadow_dom已弃用,有关更多信息,请参见 http://pub.dartlang.org/packages/shadow_dom

编辑
applicationFactory().addModule(new AppModule()).addMdoule(new NodeBindModule()).run();

第二个 addModule拼写错误( addMdoule)

关于dart - 用Angular Dart和Polymer Dart设计 Material 。编译问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24723315/

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