小编Cod*_*Spy的帖子

Angular 8 嵌套路由使用子级和相应的路由模块最多三个级别不起作用

我有一个具有三级嵌套路由的示例演示应用程序

在此处检查 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)

angular-routing angular

4
推荐指数
1
解决办法
1万
查看次数

不能将类型“ AppVersionOriginal”分配给类型“提供者”。类型“ AppVersionOriginal”缺少以下属性

我使用下面的最新版本的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)

ionic-framework ionic-native ionic4

3
推荐指数
1
解决办法
660
查看次数

显示文件夹中的随机图像,无需重复使用 JS 或 PHP

我想从目录中的文件夹中显示 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)

javascript php mysql

1
推荐指数
2
解决办法
3万
查看次数