探索Yeoman,并想知道如何更新包.
我初始化了一个角度项目
yeoman init angular
Run Code Online (Sandbox Code Playgroud)
包含在app/script/vendor(也包括在内index.html)的版本是AngularJSv1.0.1
如何升级到AngularJS v1.0.2,这是最新的.
有一个命令yeoman update,但只更新通过yeoman安装的软件包.通过自耕农安装的包裹居住在app/components.
所以,问题是
vendor和components文件夹.谢谢.
当javascript文件src路径以"/"开头时,我有使用Gruntfile.js的问题.
我按照这个用例http://briantford.com/blog/angular-yeoman.html
默认情况下,JS文件包含在内
<!-- build:js scripts/scripts.js -->
<script src="scripts/app.js"></script>
<script src="scripts/controllers/main.js"></script>
<!-- endbuild -->
$ ls dist/scripts/
ab541b7e.app.js afa864c8.scripts.js controllers vendor
$ cat dist/scripts/afa864c8.scripts.js
"use strict";var ...
....
Run Code Online (Sandbox Code Playgroud)
App Engine应用程序配置需要使用"/"前置.
<!-- build:js scripts/scripts.js -->
<script src="/scripts/app.js"></script>
<script src="/scripts/controllers/main.js"></script>
<!-- endbuild -->
Build results in the concatenated file,
$ ls dist/scripts/
9eecb7db.scripts.js ab541b7e.app.js controllers vendor
$ cat dist/scripts/9eecb7db.scripts.js
Run Code Online (Sandbox Code Playgroud)
但是,然后连接的脚本文件为空.
完整的Gruntfile如下,未经修改.
module.exports = function( grunt ) {
'use strict';
//
// Grunt configuration:
//
// https://github.com/cowboy/grunt/blob/master/docs/getting_started.md
//
grunt.initConfig({
// …Run Code Online (Sandbox Code Playgroud) 我正在使用etree通过xml文件进行递归.
import xml.etree.ElementTree as etree
tree = etree.parse('x.xml')
root = tree.getroot()
for child in root[0]:
for child in child.getchildren():
for child in child.getchildren():
for child in child.getchildren():
print(child.attrib)
Run Code Online (Sandbox Code Playgroud)
在python中避免这些嵌套for循环的惯用方法是什么.
getchildren() ? list of Element instances [#]
Returns all subelements. The elements are returned in document order.
Returns:
A list of subelements.
Run Code Online (Sandbox Code Playgroud)
我在SO中看到了一些帖子,比如 避免嵌套for循环 但是没有直接转换为我的使用.
谢谢.
我设置了Yeoman 1.0 beta来处理我的js/css任务.一切正常,如果我运行grunt server,它会启动静态服务器并将浏览器会话连接到端口9000(livereload).js/css concat,minification也在工作.
现在,有没有办法让它连接到谷歌应用程序引擎开发服务器(而不是启动静态服务器).服务器在localhost上的端口8080上运行,我希望grunt在watch下的css/js文件上重新加载网页.这些文件将由GAE服务器提供.
我rolling your own在grunt-contrib-connect 文档中看到了一个部分,但不确定它是否意味着外部服务器.据我所知,这些是Gruntfile.js的相关配置
connect: {
livereload: {
options: {
port: 8080, //*** was 9001 originally **
middleware: function (connect) {
return [
lrSnippet,
mountFolder(connect, '.tmp'),
mountFolder(connect, yeomanConfig.app)
];
}
}
},
Run Code Online (Sandbox Code Playgroud)
当我将端口号更改为8080并尝试启动时,显然它会出错.
致命错误:端口8080已被其他进程使用.
所以,我不想启动新服务器,而是通过已经运行的GAE服务器连接.
谢谢.
在打字稿中,测试私有方法的最佳方法是什么.在Angularjs中测试控制器时,有时控制器会向$ scope添加一个属性(函数),如果我不公开该属性,那么分配给$ scope,我可以测试它.有推荐的方式吗?
export class MyCtrl{
constructor($scope){
$scope.addProp = (d:string) => {
this.addProp();
}
}
private addProp(){
//...
}
}
Run Code Online (Sandbox Code Playgroud) 几年后,我再次关注Google App Engine,现在对结构感到困惑.它曾经允许我创建一个项目并使用它直到免费配额,然后升级到付费帐户.现在,我创建了一个带有Gmail帐户的项目(不是谷歌应用程序帐户,而是个人帐户).在控制台和项目仪表板上,我看到一个链接说signup for a free trial.这是一个60天的试用期Google Cloud Platform.那是什么?我不能永远使用应用引擎应用程序,只有在使用率超过免费套餐时付费吗?或现在限于60天?
谢谢.
它说,在60天后,Your instances will be paused, and you'll have the option to upgrade to a paid account. You must upgrade within 30 days of your trial ending or we won’t be able to restore your instances.所以,我的主要担心是在试用期结束后运行一个小应用程序(以前可以在免费配额中运行)需要最低付款.它让我创建一个项目而无需创建帐户google cloud platform.那么,我真的需要加入或者可以在没有加入的情况下运行应用程序引擎实例吗?
我面临的问题与https://github.com/babel/babel/issues/2504中描述的相同
所以,任何只有无状态组件的文件都需要react导入类似的import React from 'react';,这有点烦人(eslint给出错误作为未使用的变量;我理解的可以被抑制,仍然......).有没有办法避免在webpack基础设置中进行此导入.
谢谢.
我觉得有点奇怪,解决这样的承诺
.then(console.log, console.log)
Run Code Online (Sandbox Code Playgroud)
不起作用,但这是有效的
.then(d => {
console.log(d);
}, err => {
console.log(err);
});
Run Code Online (Sandbox Code Playgroud)
我错过了什么
我正在尝试在开发频道上运行一个 flutter 应用程序。这给出了以下错误。但其他一些应用程序工作正常。除了 API 兼容性之外,现有应用程序是否需要任何配置才能在开发频道上工作。请参阅下面的颤振医生等的输出。我尝试再次运行,flutter clean但结果相同。
编辑:看起来像一个 android 特定问题,因为它在 IOS 模拟器上构建和运行良好!编辑 2:它也适用于 Android Studio,但不能通过 vscode/命令行(flutter run)
flutter run --debug
Using hardware rendering with device Android SDK built for x86. If you
get graphics artifacts, consider enabling software rendering with
"--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle... 1.3s
Resolving dependencies... 1.7s
FAILURE: Build failed with an exception.
* What went wrong:
Could not determine the dependencies of task ':app:compileDebugKotlin'.
> Could not …Run Code Online (Sandbox Code Playgroud) javascript ×4
yeoman ×3
angularjs ×2
gruntjs ×2
ecmascript-6 ×1
flutter ×1
h3 ×1
promise ×1
python ×1
reactjs ×1
typescript ×1
unit-testing ×1
webpack ×1