kandi background
Explore Kits

otto | enhanced Guavabased event bus with emphasis on Android support | Pub Sub library

 by   square Java Version: Current License: Apache-2.0

 by   square Java Version: Current License: Apache-2.0

Download this library from

kandi X-RAY | otto Summary

otto is a Java library typically used in Messaging, Pub Sub applications. otto has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has high support. You can download it from GitHub.
An enhanced Guava-based event bus with emphasis on Android support. Otto is an event bus designed to decouple different parts of your application while still allowing them to communicate efficiently. Forked from Guava, Otto adds unique functionality to an already refined event bus as well as specializing it to the Android platform.
Support
Support
Quality
Quality
Security
Security
License
License
Reuse
Reuse

kandi-support Support

  • otto has a highly active ecosystem.
  • It has 5212 star(s) with 921 fork(s). There are 321 watchers for this library.
  • It had no major release in the last 12 months.
  • There are 13 open issues and 102 have been closed. On average issues are closed in 69 days. There are 5 open pull requests and 0 closed requests.
  • It has a positive sentiment in the developer community.
  • The latest version of otto is current.
otto Support
Best in #Pub Sub
Average in #Pub Sub
otto Support
Best in #Pub Sub
Average in #Pub Sub

quality kandi Quality

  • otto has 0 bugs and 0 code smells.
otto Quality
Best in #Pub Sub
Average in #Pub Sub
otto Quality
Best in #Pub Sub
Average in #Pub Sub

securitySecurity

  • otto has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
  • otto code analysis shows 0 unresolved vulnerabilities.
  • There are 0 security hotspots that need review.
otto Security
Best in #Pub Sub
Average in #Pub Sub
otto Security
Best in #Pub Sub
Average in #Pub Sub

license License

  • otto is licensed under the Apache-2.0 License. This license is Permissive.
  • Permissive licenses have the least restrictions, and you can use them in most projects.
otto License
Best in #Pub Sub
Average in #Pub Sub
otto License
Best in #Pub Sub
Average in #Pub Sub

buildReuse

  • otto releases are not available. You will need to build from source code and install.
  • Build file is available. You can build the component from source.
  • Installation instructions, examples and code snippets are available.
  • otto saves you 1137 person hours of effort in developing the same functionality from scratch.
  • It has 2569 lines of code, 184 functions and 41 files.
  • It has low code complexity. Code complexity directly impacts maintainability of the code.
otto Reuse
Best in #Pub Sub
Average in #Pub Sub
otto Reuse
Best in #Pub Sub
Average in #Pub Sub
Top functions reviewed by kandi - BETA

kandi has reviewed otto and discovered the below as its top functions. This is intended to give you an instant insight into otto implemented functionality, and help decide if they suit your requirements.

  • Load annotated methods .
  • Registers an event producer .
  • Unregisters an event producer .
  • Sets the location history .
  • Find all subscriber methods .
  • Compares this EventProducer .
  • Handles event .
  • Receives the event .
  • Notify listeners on the bus .
  • Clear location events .

otto Key Features

An enhanced Guava-based event bus with emphasis on Android support.

Download

copy iconCopydownload iconDownload
<dependency>
  <groupId>com.squareup</groupId>
  <artifactId>otto</artifactId>
  <version>1.3.8</version>
</dependency>

License

copy iconCopydownload iconDownload
Copyright 2012 Square, Inc.
Copyright 2010 Google, Inc.

Routing when there is multiple routing modules

copy iconCopydownload iconDownload
{
    path: 'blog',
    loadChildren: () => import('./blog/blog.module').then(m => m.BlogModule)
}
  {
    path: 'blog',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
const blogRoutes: Routes = [
  {
    path: '',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
];
-----------------------
{
    path: 'blog',
    loadChildren: () => import('./blog/blog.module').then(m => m.BlogModule)
}
  {
    path: 'blog',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
const blogRoutes: Routes = [
  {
    path: '',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
];
-----------------------
{
    path: 'blog',
    loadChildren: () => import('./blog/blog.module').then(m => m.BlogModule)
}
  {
    path: 'blog',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
const blogRoutes: Routes = [
  {
    path: '',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
];

How do I extract only timestamp and date at my curl script?

copy iconCopydownload iconDownload
(
  echo "• $(date -Is):"
  while read URL; do
    curl -o /dev/null --silent --head --write-out "  %{http_code} $URL\n" "$URL";
  done
) </home/otto/Desktop/todo | tee >>/home/otto/Desktop/test_results.txt

React question(route component doesn't work in &lt;Switch&gt;)

copy iconCopydownload iconDownload
<Switch>
  <Route exact path="/">
    ...
  </Route>

  // Will be matched and rendered if route above not matched
  <stockContext.Provider value={stock}>
    <Route path="/detail/:id">
      <Detail shoes={shoes} stock={stock} setStock={setStock}></Detail>
    </Route>
  </stockContext.Provider>

  // Unreachable routes!!
  <Route path="/cart">
    <Cart></Cart>
  </Route>

  <Route path="/test">
    <Test></Test>
  </Route>
    
  {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
  {/* <Route path="/:id">
    <div>아무거나 적었을때 이것이 보인다.</div>
  </Route> */}

</Switch>
<stockContext.Provider value={stock}>
  <Switch>
    <Route exact path="/">
      ...
    </Route>

    <Route path="/detail/:id">
      <Detail shoes={shoes} stock={stock} setStock={setStock} />
    </Route>

    <Route path="/cart">
      <Cart />
    </Route>

    <Route path="/test">
      <Test />
    </Route>
    
    {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
    {/* <Route path="/:id">
      <div>아무거나 적었을때 이것이 보인다.</div>
    </Route> */}

  </Switch>
</stockContext.Provider>
<Switch>
  <Route exact path="/">
    ...
  </Route>

  <Route path="/detail/:id">
    <stockContext.Provider value={stock}>
      <Detail shoes={shoes} stock={stock} setStock={setStock} />
    </stockContext.Provider>
  </Route>

  <Route path="/cart">
    <Cart />
  </Route>

  <Route path="/test">
    <Test />
  </Route>
    
  {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
  {/* <Route path="/:id">
    <div>아무거나 적었을때 이것이 보인다.</div>
  </Route> */}

</Switch>
-----------------------
<Switch>
  <Route exact path="/">
    ...
  </Route>

  // Will be matched and rendered if route above not matched
  <stockContext.Provider value={stock}>
    <Route path="/detail/:id">
      <Detail shoes={shoes} stock={stock} setStock={setStock}></Detail>
    </Route>
  </stockContext.Provider>

  // Unreachable routes!!
  <Route path="/cart">
    <Cart></Cart>
  </Route>

  <Route path="/test">
    <Test></Test>
  </Route>
    
  {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
  {/* <Route path="/:id">
    <div>아무거나 적었을때 이것이 보인다.</div>
  </Route> */}

</Switch>
<stockContext.Provider value={stock}>
  <Switch>
    <Route exact path="/">
      ...
    </Route>

    <Route path="/detail/:id">
      <Detail shoes={shoes} stock={stock} setStock={setStock} />
    </Route>

    <Route path="/cart">
      <Cart />
    </Route>

    <Route path="/test">
      <Test />
    </Route>
    
    {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
    {/* <Route path="/:id">
      <div>아무거나 적었을때 이것이 보인다.</div>
    </Route> */}

  </Switch>
</stockContext.Provider>
<Switch>
  <Route exact path="/">
    ...
  </Route>

  <Route path="/detail/:id">
    <stockContext.Provider value={stock}>
      <Detail shoes={shoes} stock={stock} setStock={setStock} />
    </stockContext.Provider>
  </Route>

  <Route path="/cart">
    <Cart />
  </Route>

  <Route path="/test">
    <Test />
  </Route>
    
  {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
  {/* <Route path="/:id">
    <div>아무거나 적었을때 이것이 보인다.</div>
  </Route> */}

</Switch>
-----------------------
<Switch>
  <Route exact path="/">
    ...
  </Route>

  // Will be matched and rendered if route above not matched
  <stockContext.Provider value={stock}>
    <Route path="/detail/:id">
      <Detail shoes={shoes} stock={stock} setStock={setStock}></Detail>
    </Route>
  </stockContext.Provider>

  // Unreachable routes!!
  <Route path="/cart">
    <Cart></Cart>
  </Route>

  <Route path="/test">
    <Test></Test>
  </Route>
    
  {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
  {/* <Route path="/:id">
    <div>아무거나 적었을때 이것이 보인다.</div>
  </Route> */}

</Switch>
<stockContext.Provider value={stock}>
  <Switch>
    <Route exact path="/">
      ...
    </Route>

    <Route path="/detail/:id">
      <Detail shoes={shoes} stock={stock} setStock={setStock} />
    </Route>

    <Route path="/cart">
      <Cart />
    </Route>

    <Route path="/test">
      <Test />
    </Route>
    
    {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
    {/* <Route path="/:id">
      <div>아무거나 적었을때 이것이 보인다.</div>
    </Route> */}

  </Switch>
</stockContext.Provider>
<Switch>
  <Route exact path="/">
    ...
  </Route>

  <Route path="/detail/:id">
    <stockContext.Provider value={stock}>
      <Detail shoes={shoes} stock={stock} setStock={setStock} />
    </stockContext.Provider>
  </Route>

  <Route path="/cart">
    <Cart />
  </Route>

  <Route path="/test">
    <Test />
  </Route>
    
  {/* 모든 경로에서 보인다. 지금은 Switch 컴포넌트 안에있어서 Router들이 하나만보인다. */}
  {/* <Route path="/:id">
    <div>아무거나 적었을때 이것이 보인다.</div>
  </Route> */}

</Switch>

CSS box shadow animation on table cell with background color

copy iconCopydownload iconDownload
tr {
  position:relative;
  z-index:0;
}

tr.pulse-row {
  animation: pulse 1s infinite;
  z-index:1;
}



@keyframes pulse {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
  }
  70% {
    -webkit-box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
  }
  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

body {
  padding: 20px
}

td.is-fixed-left {
  background-color: #f9f9f9;  
  z-index: 3;
  position: sticky;
}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <table class="table">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td class="is-fixed-left">Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr class="pulse-row">
      <th scope="row">2</th>
      <td class="is-fixed-left">Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td class="is-fixed-left">Larry</td>
      <td>the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</table>
</body>
</html>
-----------------------
tr {
  position:relative;
  z-index:0;
}

tr.pulse-row {
  animation: pulse 1s infinite;
  z-index:1;
}



@keyframes pulse {
  0% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
  }
  70% {
    -webkit-box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
  }
  100% {
    -webkit-box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
  }
}

body {
  padding: 20px
}

td.is-fixed-left {
  background-color: #f9f9f9;  
  z-index: 3;
  position: sticky;
}
<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>JS Bin</title>
</head>
<body>
  <table class="table">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td class="is-fixed-left">Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr class="pulse-row">
      <th scope="row">2</th>
      <td class="is-fixed-left">Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td class="is-fixed-left">Larry</td>
      <td>the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
<script src="https://code.jquery.com/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
</table>
</body>
</html>
-----------------------
tr.pulse-row {
      animation: pulse 1s infinite;
      position:relative;
      z-index:99;
    }
    
    @keyframes pulse {
      0% {
        -webkit-box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
      }
      70% {
        -webkit-box-shadow: 0 0 0 10px rgba(255, 0, 0, 0);
      }
      100% {
        -webkit-box-shadow: 0 0 0 0 rgba(255, 0, 0, 0);
      }
    }
    
    body {
      padding: 20px
    }
    
    td.is-fixed-left {
      background-color: #f9f9f9;  
      z-index: 3;
      position: sticky;
    }

Sparql - How to specifiy Property paths with regex

copy iconCopydownload iconDownload
SELECT DISTINCT ?descendant ?descendantLabel
WHERE
{
  wd:Q8442 wdt:P40/wdt:P40?/wdt:P40? ?descendant.
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} 

Exclude words with pattern 'xyyx' but include words that start &amp; ends with same letter

copy iconCopydownload iconDownload
^(?!.*(.)(.)\2\1)(.).*\3$
-----------------------
oopso
livewell

AD-user script has no output

copy iconCopydownload iconDownload
$ADUsers = Import-Csv -Delimiter ';' -Path 'C:\Users\Desktop\Powershell files\EM-mis-new-AD.csv'
-----------------------
#helpers
        function usernameIsNotBlank {
            [CmdletBinding()]
            param(
                $Username
            )
            [regex]$rx = "\S"
            
            return $rx.match($Username)
        }
        
        function usernameDoesNotAlreadyExist {
            [CmdletBinding()]
            param(
                $Username
            )
            $UserDoesNotExist = $true
            
            $UserObject = $(
                try {
                    Get-ADUser $Username
                }
                catch {
                    $null
                }
            )
        
            if ($null -ne $UserObject) {
                $UserDoesNotExist = $false
                Write-Verbose "$Username already exists"
                
            }
            else {
                $UserDoesNotExist = $true
            }
        
            return $UserDoesNotExist
        }
        
        function suppliedUsernameIsAvailable {
            [CmdletBinding()]
            param(
                $Username
            )
        
            return ((usernameIsNotBlank -Username $Username) -and (usernameDoesNotAlreadyExist -Username $Username))
        }
        
    #script
        $OriginalVerbose = $VerbosePreference
        $VerbosePreference = "Continue"
        Import-Module ActiveDirectory
        
        $CSV = "C:\Users\Desktop\Powershell file\EM-mis-new-AD.csv"
        $Data = Import-CSV $CSV
        
        foreach ($Line in $Data) {
            if (suppliedUsernameIsAvailable($Line.username)) {
                New-ADUser -Name "$Line.firstname $Line.lastname" -GivenName "$Line.firstname" -Surname "$Line.lastname" -SamAccoutnname "$(Line.username)@mydomain.com" -AccountPassword (ConvertTo-SecureString $Line.password -AsPlainText -Force) -ChangePasswordAtLogon $true -Path "$Line.ou"
            }
        }
        $VerbosePreference = $OriginalVerbose

methods called twice: once with and once without parameters; how to prevent this behaviour?

copy iconCopydownload iconDownload
            self.ids.sort_asc_btn.on_release = self.wanted_method
            self.ids.sort_desc_btn.on_release = self.wanted_method
        Button:
            id: sort_asc_btn
            background_color: cust_rgba('#3aeaea')
            text: 'sort Asc'
            on_release: root.sort_by(sort_id=self.text, sort_value=header_label.text)
        Button:
            id: sort_desc_btn
            background_color: cust_rgba('#3aeaea')
            text: 'sort Desc'
            on_release: root.sort_by(sort_id=self.text, sort_value=header_label.text)
-----------------------
            self.ids.sort_asc_btn.on_release = self.wanted_method
            self.ids.sort_desc_btn.on_release = self.wanted_method
        Button:
            id: sort_asc_btn
            background_color: cust_rgba('#3aeaea')
            text: 'sort Asc'
            on_release: root.sort_by(sort_id=self.text, sort_value=header_label.text)
        Button:
            id: sort_desc_btn
            background_color: cust_rgba('#3aeaea')
            text: 'sort Desc'
            on_release: root.sort_by(sort_id=self.text, sort_value=header_label.text)

Bootstrap 5 - Unwanted white space at the bottom

copy iconCopydownload iconDownload
body {
    min-height: 75rem;
    padding-top: 4.5rem;
}

How can I set border-radius on table head in Bootstrap 5?

copy iconCopydownload iconDownload
table {
 border-radius: 9px;
 overflow: hidden /* add this */
}

/* Or do this */

thead th:first-child {
 border-top-left-radius: 9px;
}

thead th:last-child {
 border-top-right-radius: 9px;
}

tbody tr:last-child :first-child {
 border-bottom-left-radius: 9px;
}

tbody tr:last-child :last-child {
 border-bottom-right-radius: 9px;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">


<table class="table table-dark table-hover">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>Larry</td>
      <td>the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
</table>
-----------------------
table {
 border-radius: 9px;
 overflow: hidden /* add this */
}

/* Or do this */

thead th:first-child {
 border-top-left-radius: 9px;
}

thead th:last-child {
 border-top-right-radius: 9px;
}

tbody tr:last-child :first-child {
 border-bottom-left-radius: 9px;
}

tbody tr:last-child :last-child {
 border-bottom-right-radius: 9px;
}
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet">


<table class="table table-dark table-hover">
  <thead>
    <tr>
      <th scope="col">#</th>
      <th scope="col">First</th>
      <th scope="col">Last</th>
      <th scope="col">Handle</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <th scope="row">1</th>
      <td>Mark</td>
      <td>Otto</td>
      <td>@mdo</td>
    </tr>
    <tr>
      <th scope="row">2</th>
      <td>Jacob</td>
      <td>Thornton</td>
      <td>@fat</td>
    </tr>
    <tr>
      <th scope="row">3</th>
      <td>Larry</td>
      <td>the Bird</td>
      <td>@twitter</td>
    </tr>
  </tbody>
</table>

Community Discussions

Trending Discussions on otto
  • Routing when there is multiple routing modules
  • How do I extract only timestamp and date at my curl script?
  • React question(route component doesn't work in &lt;Switch&gt;)
  • Supabase-Py: TypeError: __init__() got an unexpected keyword argument 'headers' when making client
  • CSS box shadow animation on table cell with background color
  • Add border at the end of bootstrap table
  • Sparql - How to specifiy Property paths with regex
  • Exclude words with pattern 'xyyx' but include words that start &amp; ends with same letter
  • AD-user script has no output
  • methods called twice: once with and once without parameters; how to prevent this behaviour?
Trending Discussions on otto

QUESTION

Routing when there is multiple routing modules

Asked 2022-Apr-14 at 15:05

I'm trying to create a blog using Angular 13. I want to separate admin from the main page. I have 3 routing modules. app-routing.module.ts:

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

const routes: Routes = [
  //blog routes
  {
    path: '',
    redirectTo: '/blog',
    pathMatch: 'full' //means path needs to be full match with what has been configured.
  },
  {
    path: 'blog',
    loadChildren: () => import('./blog/blog.module').then(m => m.BlogModule) //() means Function
    //we use loadChildren when we want to use lazy loading. The other option is 'children'.
  },
  //auth routes
  {
    path: '',
    redirectTo: '/auth',
    pathMatch: 'full'
  },
  {
    path: 'auth',
    loadChildren: () => import('./auth/auth.module').then(m => m.AuthModule)
  }
];

@NgModule({
  imports: [RouterModule.forRoot(routes)],
  exports: [RouterModule]
})
export class AppRoutingModule { }

blog-routing.module.ts:

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { BlogComponent } from '../layout/blog/blog.component';
import { FocusContentComponent } from '../layout/blog/focus-content/focus-content.component';

const blogRoutes: Routes = [
  {
    path: '',
    component: BlogComponent
  },
  {
    path: 'blog',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
];

auth-routing.module.ts:

import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AuthComponent } from '../layout/auth/auth.component';

const routes: Routes = [
  {
    path: '',
    component: AuthComponent
  },
  {
    path: 'auth',
    component: AuthComponent
  }
];

@NgModule({
  imports: [RouterModule.forChild(routes)],
  exports: [RouterModule]
})
export class AuthRoutingModule { }

The problem is that there is routing problem when I use http://localhost:4200/blog/mainpost. The console says that

cannot match any routes. URL Segment: 'blog/mainpost'

blog.component.html is:

<!DOCTYPE html>
<html lang="en" dir="rtl">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <meta name="description" content="" />
    <meta
      name="author"
      content="Mark Otto, Jacob Thornton, and Bootstrap contributors"
    />
    <meta name="generator" content="Hugo 0.88.1" />
    <title>Science Blog</title>
  </head>

  <body>
    <app-header></app-header>

    <main class="container">
      <app-focus-content></app-focus-content>

      <app-important-content></app-important-content>

      <div class="row g-5">
        <div class="col-md-8">
          <!-- <app-main-body> -->
          <router-outlet name="post"></router-outlet>
          <!-- </app-main-body> -->
        </div>

        <div class="col-md-4">
          <app-history-pannel></app-history-pannel>
        </div>
      </div>
    </main>
    <app-footer></app-footer>
  </body>
</html>

How can I fix this problem?

ANSWER

Answered 2022-Apr-14 at 15:05

in app module you have

{
    path: 'blog',
    loadChildren: () => import('./blog/blog.module').then(m => m.BlogModule)
}

which is the route /blog.

Then in your blog module you have

  {
    path: 'blog',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }

Which are the routes /blog/blog and /blog/blog/mainpost.

Try moving the children in the route above

const blogRoutes: Routes = [
  {
    path: '',
    component: BlogComponent,
    children: [
      {
        path: 'mainpost',
        component: FocusContentComponent,
        outlet: 'post'
      }
    ]
  }
];

Source https://stackoverflow.com/questions/71870242

Community Discussions, Code Snippets contain sources that include Stack Exchange Network

Vulnerabilities

No vulnerabilities reported

Install otto

Downloadable .jars can be found on the [GitHub download page][2].

Support

For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .

DOWNLOAD this Library from

Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

Explore Related Topics

Share this Page

share link
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from
over 430 million Knowledge Items
Find more libraries
Reuse Solution Kits and Libraries Curated by Popular Use Cases

Save this library and start creating your kit

  • © 2022 Open Weaver Inc.