我正在 ionic 4 应用程序中实现 Deeplink。应用程序启动但深层链接插件总是返回false;
app.routing.ts:
{
path: 'viewdiary/:id/public',
loadChildren: () => import('./pages/viewdiary/viewdiary.module').then( m => m.ViewdiaryPageModule)
},
Run Code Online (Sandbox Code Playgroud)
app.component.ts:
setupDeepLink(){
this.deeplinks.route({
'/viewdiary/:id/public': 'viewdiary/:id/public'
}).subscribe((match)=>{
console.log('deeplink matched', match);
const internalPath = `${match.$route}/${match.$args['id']}/${match.$route}`;
console.log(internalPath);
this.zone.run(()=>{
this.general.goToPage(internalPath);
});
},
nomatch=>{
// nomatch.$link - the full link data
console.error("Got a deeplink that didn't match", nomatch);
})
};
Run Code Online (Sandbox Code Playgroud)
我的公共日记页面链接'https://www.example.com/diary/12542/public';
看起来像是路由问题,尝试了很多更改名称但没有任何效果。我不知道出了什么问题。
javascript deep-linking hybrid-mobile-app ionic-framework angular
从事项目并陷入问题:
硬件后退按钮重装应用程序(我在此应用程序中使用Angular Router)。
我的退出应用程序代码:
ionViewDidEnter(){
this.subscription = this.platform.backButton.subscribe(()=>{
navigator['app'].exitApp();
});
}
ionViewWillLeave(){
this.subscription.unsubscribe();
}
Run Code Online (Sandbox Code Playgroud)
同时在其他应用程序中工作。但在此应用程序中,其重新加载应用程序不会退出。
PS:我也试过了,platform.ready()但是没有运气。
一切都很好,工作完美,直到我执行命令"ionic build android",然后发生此错误.
:transformClassesWithDexForDebugjava.lang.UnsupportedClassesVersionError:com.android.dx/command/Main:不支持的Major.minor版本52.0
等等......
我想通过比较 2 个数组从数组中删除相同的对象。
样本数据:
arr1 = [
{id: 1, name: "a"},
{id: 2, name: "b"},
{id: 3, name: "c"},
{id: 4, name: "d"},
];
arr2 = [
{id: 1, name: "a"},
{id: 4, name: "d"},
];
let newArray = []; // new array with with no same values it should be unique.
arr1.map((val, i)=>{
arr2.map((val2)=>{
if(val.id == val2.id){
console.log('Matched At: '+ i) // do nothing
}else{
newArray.push(val);
}
})
})
console.log(newArray); // e.g: [{id: 2, name: "b"}, {id: 3, name: …Run Code Online (Sandbox Code Playgroud) 我从 API(服务器)动态生成了不一致的对象数组。
例如:
array = [
{name: 'blah', age:2},
{status: 'pending', date: '20-20-2020'},
{blah: 'foo', google: 'bar'},
{apple: 'android', microsoft: 'eeewww'}
]
Run Code Online (Sandbox Code Playgroud)
这个数组可以是具有不同键和值的任何东西。
我如何遍历它以显示中的值
ngFor?
我目前正在做的事情:
this.printArray = JSON.stringify(JSON.parse(this.array), null, 4);
<div *ngFor="let print of printArray">
{{print}} // it prints the array like {"name": blah, "age": 2} but i don't want it in this way
</div>
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用离子v3弹出窗口。我也实现了相同的功能。我有一个疑问,是否像ionic v1一样在ionic 3中有弹出箭头。如果是,则是什么特定的html标签。我们在ionic 1中有,但在ionic v3中不支持。我没找到。