我有一个具有三级嵌套路由的示例演示应用程序
在此处检查 Stackblitz
一级导航链接
-Dashboard
-My Profile
-My Attendance
-My leaves --->
-Apply Leave
-Check Leave Balance ----->
-Casual
-Earned
-Bad Link
Run Code Online (Sandbox Code Playgroud)
问题:最后两个链接(Casual 和 Earned)应该显示各自的组件,但显示“ pnf404leave 有效! ”,即使没有找到它也应该显示“ pnf404balance 有效! ”
有3个路由module.ts文件
app-routing.module.ts
//app-routing.module.ts
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { DashboardComponent } from './dashboard/dashboard.component';
import { ProfileComponent } from './profile/profile.component';
import { AttendanceComponent } from './attendance/attendance.component';
import { Page404Component } from './page404/page404.component';
import { LeavesComponent } from …
Run Code Online (Sandbox Code Playgroud) 我使用下面的最新版本的Ionic CLI v4.9.0创建了新的Ionic 3应用程序
$ ionic start Ionic3Project blank --type ionic-angular
Run Code Online (Sandbox Code Playgroud)
默认情况下会创建V4 Ionic项目。
然后我在这里按照步骤进行本机应用程序版本插件
导入app.module.ts文件时遇到以下控制台错误
Uncaught Error: Invalid provider for the NgModule 'AppModule' - only instances of Provider and Type are allowed, got: [StatusBar, ?[object Object]?, ...]
at syntaxError (compiler.js:486)
at compiler.js:15784
at Array.forEach (<anonymous>)
at CompileMetadataResolver._getProvidersMetadata (compiler.js:15752)
at CompileMetadataResolver.getNgModuleMetadata (compiler.js:15320)
at JitCompiler._loadModules (compiler.js:34413)
at JitCompiler._compileModuleAndComponents (compiler.js:34374)
at JitCompiler.compileModuleAsync (compiler.js:34268)
at CompilerImpl.compileModuleAsync (platform-browser-dynamic.js:239)
at PlatformRef.bootstrapModule (core.js:5578)
Run Code Online (Sandbox Code Playgroud)
app.module.ts文件
import { BrowserModule } from '@angular/platform-browser';
import { …
Run Code Online (Sandbox Code Playgroud) 我想从目录中的文件夹中显示 10-15 张图像,但我不想重复显示它们。我也不想使用 MySQL 表
请帮忙。
目前我正在使用以下代码
$imglist='';
$img_folder = "gallerypage/small/";
mt_srand((double)microtime()*1000);
$imgs = dir($img_folder);
while ($file = $imgs->read()) {
$imglist .= "$file"."|";
} closedir($imgs->handle);
$imglist = explode("|", $imglist);
//print_r($imglist);
$no = sizeof($imglist)-2;
//echo $no;
for ($i=0; $i<=$no; $i++)
{
$random = $i; // mt_rand($i, $no/$i);
//echo $random;
$fileb =
$image = $imglist[$i];
$fileb = $image;
if($image != '.' && $image != '..' && $image != 'Thumbs.db' )
{
//echo '<img src="'.$img_folder.$image.'" border=0>';
//if($image != ""){
//echo "k".$image."k";
echo "<a …
Run Code Online (Sandbox Code Playgroud)