我没有很长时间构建,所以我不知道这是否是新的,但最近我决定使用async
和await
来使代码看起来更好。但是,我试图建立只是为了在JS上工作,但我得到两个案例取决于我在pubspec.yaml
中包含的内容:
main.dart.js
文件。redstone_mapper
这个pubspec.yaml
我得到了第一个案例
name: aristadart
description: A sample web application
dependencies:
angular: 1.0.0
browser: any
di: any
fp: any
http: any
mongo_dart: any
redstone: any
redstone_mapper: any
redstone_mapper_mongo: any
shelf_static: any
async_await:
git: https://github.com/dart-lang/async_await.git
transformers:
- async_await
- redstone_mapper
- angular:
html_files:
- lib/components/login/login.html
- lib/components/login/nuevo_usuario.html
- lib/components/home/home.html
- lib/components/evento/evento.html
- lib/components/vista/vista.html
dependency_overrides:
analyzer: ^0.22.4
barback: ^0.15.2+2
code_transformers: ^0.2.3+2
di: ^3.3.3
route_hierarchical: ^0.6.1
这是我的index.html
<!DOCTYPE html>
<html ng-app class="no-js" lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Arista Client</title>
<link rel="stylesheet" href="css/arista.css" />
<link rel="stylesheet" href="css/foundation.css" />
<script src="js/vendor/modernizr.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400,600' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
</head>
<body style="background-color:#e6e4e3">
<nav style= "background-color:#517dbe" class="tab-bar">
<div class="left-small">
<a class="item menu-icon">
<span>
</span>
</a>
</div>
<div class="middle tab-bar-section">!Bienvenidos a ARISTA Client </div>
<div class = "right tab-bar-section">
<a href="#" ng-click="logout()"
class="button radius right tiny"
ng-if="LoggedIn">
Logout
</a>
</div>
</nav>
<br>
<div class="large-8 small-centered columns" style="background-color:white" class="sombra">
<br>
<ng-view></ng-view>
</div>
<a data-options="align:left" data-dropdown="dropInfo" aria-controls="drop1" aria-expanded="true"></a>
<ul id="dropInfo" class="f-dropdown" data-dropdown-content aria-hidden="false" tabindex="-1">
<li><a href="#">This is a link</a></li>
</ul>
<script src="/js/vendor/fastclick.js"></script>
<script src="js/vendor/jquery.js"></script>
<script src="js/foundation.min.js"></script>
<script type="application/dart" src="main.dart"></script>
<script type="text/javascript" src="packages/browser/dart.js"></script>
<script>
$(document).foundation();
</script>
</body>
</html>