我使用默认的config.xml创建了一个新的phonegap(v 3.0.0-0.14.0)项目,然后添加了iOS和Android平台.
配置包含所有平台图标的所有路径.
我已经覆盖了iOS和Android的默认图标,因此路径和名称仍然匹配那些png.
在模拟器中运行时,图标不会显示.我在xCode中查找了它,它告诉我图标的"Resources"文件夹仍然包含phonegap默认图标.与Android相同.
我究竟做错了什么?
如何使用phonegap为iOS和Android添加自定义应用图标?
谢谢
我的config.xml
<icon src="icon.png" />
<icon gap:density="ldpi" gap:platform="android" src="res/icon/android/icon-36-ldpi.png" />
<icon gap:density="mdpi" gap:platform="android" src="res/icon/android/icon-48-mdpi.png" />
<icon gap:density="hdpi" gap:platform="android" src="res/icon/android/icon-72-hdpi.png" />
<icon gap:density="xhdpi" gap:platform="android" src="res/icon/android/icon-96-xhdpi.png" />
<icon gap:platform="ios" height="57" src="res/icon/ios/icon-57.png" width="57" />
<icon gap:platform="ios" height="72" src="res/icon/ios/icon-72.png" width="72" />
<icon gap:platform="ios" height="114" src="res/icon/ios/icon-57-2x.png" width="114" />
<icon gap:platform="ios" height="144" src="res/icon/ios/icon-72-2x.png" width="144" />
<icon gap:platform="blackberry" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="blackberry" gap:state="hover" src="res/icon/blackberry/icon-80.png" />
<icon gap:platform="webos" src="res/icon/webos/icon-64.png" />
<icon gap:platform="winphone" src="res/icon/windows-phone/icon-48.png" />
<icon gap:platform="winphone" gap:role="background" src="res/icon/windows-phone/icon-173.png" />
Run Code Online (Sandbox Code Playgroud) 我创建了一个Yeoman生成器,希望我的团队使用它.
如果我在Github上更新我的生成器会发生什么?他们在旧版本中本地安装了生成器.他们是否总是必须再次安装才能获得最新版本?
团队成员不知道何时发生更新,我不希望他们过多关注它.我只是想让他们使用最新版本的发电机.
更新发电机的建议方法是什么?
谢谢
我正在尝试使用requirejs和grunt-contrib-qunit设置QUnit环境.
这就是我所拥有的.
gruntfile:
qunit: {
all: {
options: {
urls: [
'http://localhost:8000/qunit/qunit-test-suite.html'
]
}
}
},
connect: {
server: {
options: {
port: 8000,
base: '.'
}
}
},
Run Code Online (Sandbox Code Playgroud)
qunit试验suite.html:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QUnit Tests Suite: travis CI Test</title>
<link rel="stylesheet" href="../components/libs/qunit/qunit/qunit.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script src="../components/libs/qunit/qunit/qunit.js"></script>
<script>
QUnit.config.autoload = false;
QUnit.config.autostart = false;
</script>
<script data-main="qunit" src="../components/libs/requirejs/require.js"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
qunit.js:
require.config({
baseUrl: "../",
paths: {
'jquery': 'components/libs/jquery/dist/jquery.min',
// Test for Foo
'foo': 'components/app/foo/foo', …
Run Code Online (Sandbox Code Playgroud) canLoad
和canActivate
@select
问题:为什么在从那时起打破所有路由的同时canActivate
使用@select
返回的observable canLoad
?这两名警卫有什么区别?
相关的角度问题:https://github.com/angular/angular/issues/18991
auth.guard.ts
@Injectable()
export class AuthGuard implements CanLoad, CanActivate {
@select() readonly authenticated$: Observable<boolean>; // @angular-redux/store
canLoad(): Observable<boolean> | boolean {
// return true; // works
return this.authenticated$; // ERROR: all routing stops from and to the current page
}
canActivate(): Observable<boolean> | boolean {
// return true; // works
return this.authenticated$; // works
}
}
Run Code Online (Sandbox Code Playgroud)
APP-routing.module
const routes: Routes = …
Run Code Online (Sandbox Code Playgroud) 这是一个模拟的angular2项目.
当从redux存储中使用可观察流时,我尝试先过滤,然后取/ takeLast/last最新值.之后,我希望在流完成时解析promise,但在使用takeLast运算符时则不会.
所以问题是:我可以使用哪种运算符设置来从流中获取最新值?
我将Angular 2设置简化为RxJs用法的要点.
这是一个有效的例子:https://fiddle.jshell.net/markus_falk/an41z6g9/
redux商店模拟:
var latestTime$ = new Rx.Subject();
setInterval(function(){
latestTime$.onNext(Date.now());
}, 2000);
Run Code Online (Sandbox Code Playgroud)
服务注入模拟:
var timeStore = null;
var getLatestTime = function() {
return new Promise((resolve, reject) => {
latestTime$
/*
filter out 'null' for when the button is clicked
before the store updates the first time
*/
.filter(function(x) {
console.log('filter: ', x);
return x === typeof('number');
})
// try to end to stream by …
Run Code Online (Sandbox Code Playgroud) 如何从父路由的守卫重定向到子路由,同时保护子路由不被直接访问*?
绝对导航的问题,当导航到子路由时,父组件上的守卫会在循环中再次调用。
相对导航的问题在于守卫正在保护父路线,因此还没有激活的路线可以相对导航。此外,这可能不会保护子路由。也许同样的守卫也可以与子路由或 CanActivateChildren 一起使用。
Stackblitz 示例:https ://stackblitz.com/edit/angular-qbe2a7
路线
const appRoutes: Routes = [
{
path: 'foo',
component: FooComponent,
canActivate: [ RedirectionGuard ],
children: [
{
path: 'foo-child',
component: FooChildComponent
}
]
}
];
Run Code Online (Sandbox Code Playgroud)
守卫中的 canActivate()
canActivate(
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot
): Observable<boolean>|Promise<boolean>|boolean {
console.log('guard: ', route, state, this.route);
// idea: create own ActivatedRoute and give it the values from ActivatedRouteSnapshot which knows about 'foo/'
const foo: ActivatedRoute = new ActivatedRoute();
console.log(foo);
// Error: Cannot …
Run Code Online (Sandbox Code Playgroud) angular ×3
javascript ×3
redux ×2
cordova ×1
observable ×1
phantomjs ×1
qunit ×1
requirejs ×1
rxjs ×1
yeoman ×1