我想routerLink在 angular 7 应用程序中使用。
app.routingts.ts
const routes: Routes = [
{
path: '',
component: AdminComponent,
children: [
{ path: 'dashboard', loadChildren: './dashboard/dashboard.module#DashboardModule' },
{ path: 'drivers', loadChildren: './drivers/drivers.module#DriversModule' }
]
}
];
Run Code Online (Sandbox Code Playgroud)
管理 html
<app-nav></app-nav>
<router-outlet></router-outlet>
Run Code Online (Sandbox Code Playgroud)
仪表板html
<app-nav></app-nav>
<router-outlet></router-outlet>
Run Code Online (Sandbox Code Playgroud)
来自导航组件的 HTML
<a class="nav-link" [routerLink]="['/drivers']">Drivers<span class="sr-only">
Run Code Online (Sandbox Code Playgroud)
错误
core.js:1449 ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'drivers'
Error: Cannot match any routes. URL Segment: 'drivers'
Run Code Online (Sandbox Code Playgroud) 在我的应用程序中,我在ng2-smart-table的下拉列表中加载了动态值.现在我必须在ng2-smart-table中的下拉列表中启用多个选择.
注意:下拉列表中的多项选择不是复选框.
我用于在应用程序ng2-smart-table中显示数据angular 6。我启用了过滤功能。现在我想将search所有占位符中的默认设置为文本columns。我已经搜索了很多。但我无法更改过滤器的占位符。
<ng2-smart-table [settings]="setting" [source]="dataSource"></ng2-smart-table>
Run Code Online (Sandbox Code Playgroud)
在 .ts 文件中。
add: {
confirmCreate: false
},
columns: {
id: {
title: 'ID',
filter: true
},
name: {
title: 'First Name',
filter: true
},
}
Run Code Online (Sandbox Code Playgroud) 我是 mongoDb 的新手。我已经设置了两个集合。1) 书 2) 评论
book :
_id
title
author
posted
price
Run Code Online (Sandbox Code Playgroud)
和评论是:
_id
bookId
comment
status
Run Code Online (Sandbox Code Playgroud)
我想得到那些书的评论status = 1。
我试过这个。
return new promise((resolve, reject) => {
db.collection('book').aggregate([
{
$lookup:{
from:'comments',
localField: "_id",
foreignField: "bookId",
as: "comments"
}
}
]).toArray().then((result) => {
if(result.length > 0){
res.send({ status: 1, message: "Success.", data:result });
}else{
res.send({ status: 0, message: "No data found." });
}
}).catch((err) => {
res.send({ status: 0, message: "Something went wrong."});
});
});
Run Code Online (Sandbox Code Playgroud)
当我调用我的 API 时,我在邮递员那里得到了这个。 …
我在 php 中有 API,在该 API 中,我在 AWS S3 中上传图像按预期工作,但是从 S3 获取数据在移动设备上加载需要太多时间。
任何人都可以帮助我解决缓慢的图像加载问题吗?
我正在寻找在 android 和 IOS 中加载快速图像的最佳方式。
注意:我没有使用任何拇指作为图像。
在 Angular 应用程序中,我使用了ng2-smart-table. 我已经启用了分页。但它显示正常的外观。我没有使用默认外观,而是使用带有页面选项的下拉菜单。
<select>
<option>5</option>
<option>10</option>
<option>15</option>
</select>
Run Code Online (Sandbox Code Playgroud)
我也设置了更改事件。
问题:
1)如何更新ng2-smart-table以根据值更改设置页面大小。
2)我也想在特定页面上移动。例如:表有 1000 条数据,每个寻呼机有 10 条记录。所以我只想在14. 那么,我该怎么做呢?
为此,我参考了它的文档,但我没有得到任何事件。
在我的应用程序中,要调用POST我使用的所有请求service。
当我从服务器获取特定代码(例如:401)时,我调用 API 来获取新令牌。
直到收到另一个令牌,如果有任何其他 API 调用,我将所有这些请求存储在一个数组中。它可能是n 个请求。现在假设有 3 个 API 调用,同时对 newToken API 的调用正在进行中。
获得新令牌后,我必须将其传递到所有后续 API 中。现在我必须执行所有待处理的 API 请求并将数据提供给它们各自的调用。
代码示例:
api.service.ts
POST(URL , param){
return new Observable<any>(observer => {
let headers = new HttpHeaders({
'Content-Type': 'Content-Type': 'application/json'
});
let options = {
headers: headers
};
this.http.post(URL, param, options)
.subscribe(data => {
var apiRes: any = data;
this.inValidSession();
observer.next();
observer.complete();
}
......
// For execute pending request I have set …Run Code Online (Sandbox Code Playgroud) angular ×4
amazon-s3 ×1
angular6 ×1
file ×1
mongodb ×1
observable ×1
php ×1
placeholder ×1
request ×1
routes ×1