Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 18:53
    alenseeman starred angular/angular
  • 18:42
    ngbot[bot] milestoned #39085
  • 18:42
    josephperrott labeled #39085
  • 18:42
    josephperrott assigned #39085
  • 18:42
    josephperrott commented #39085
  • 18:41
    alxhub synchronize #39048
  • 18:37
    atscott synchronize #39060
  • 18:36
    googlebot labeled #39086
  • 18:36
    ngbot[bot] milestoned #39086
  • 18:36
    josephperrott labeled #39086
  • 18:36
    josephperrott labeled #39086
  • 18:36
    josephperrott opened #39086
  • 18:33
    josephperrott closed #39078
  • 18:33

    josephperrott on master

    build(docs-infra): upgrade cli … (compare)

  • 18:27
    Gennady77 opened #39085
  • 18:25
    wardbeyens starred angular/angular
  • 18:22
    atscott synchronize #39060
  • 18:20
    atscott synchronize #39060
  • 18:17
    jelbourn commented #30940
  • 18:16
    jelbourn reopened #30940
DoraRajappan
@DoraRajappan
nginx is opensource right? can I have an authentic url to downd the isntallable?
Mile Mijatović
@mijatovicmile
@yosiasz I just draw coordinate system with two rectangles
where one rectangle overlap other
that's clear
Weston
@ronnyek
 (min(r1.x, r2.x) -  
                 max(l1.x, l2.x)) *  
                (min(r1.y, r2.y) - 
                 max(l1.y, l2.y));
DoraRajappan
@DoraRajappan
nginx is most popular http server
the docker approach is also a nice one to try for ngnix
DoraRajappan
@DoraRajappan
thank you ... seeems there is a plus version icensed perhaps?
Mile Mijatović
@mijatovicmile
@ronnyek what's r1 and l1 ?
r1 - rectangle 1 ?
DoraRajappan
@DoraRajappan
first I have to fix the hash routing then I will try docker
8 replies
Mile Mijatović
@mijatovicmile
what's l1 ?
Weston
@ronnyek
points
exectp that is calculating the total of both rectangles intersecting
sounds like you might just need to know the area of the intersection itself
DoraRajappan
@DoraRajappan
yes both - intersection
Weston
@ronnyek
well I cant tell from the question if they want total area of both rectangles which would be the area of each minus the intersection area
but if they just wanted the total area of the intersection area
its the areaI
Mile Mijatović
@mijatovicmile
Ok, thanks
but I am still not sure how to do that
Mile Mijatović
@mijatovicmile
anyone have another solution ?
Gennady77
@Gennady77
hello. help to run unit tests. I try to run npm run test-ivy-aot and I got an error ERROR: An error occurred during the fetch of repository 'npm':
yarn_install failed: yarn install v1.22.5
Oscar Flores
@oscar-stokkup
hi everyone. so i have a login page with my auth guard, but im having issues where when i login (and everything is successful) it doesnt redirect to the next page it stays on the login page... im going insane trying to figure it out any help / guidance?
DoraRajappan
@DoraRajappan
export class AuthGuard implements CanActivate, CanActivateChild  {
  constructor(private authService: UserService, private router: Router) {}
  canActivate(
    next: ActivatedRouteSnapshot,
    state: RouterStateSnapshot): boolean| UrlTree {
      let url: string = state.url;

    return this.isLoggedIn();

  }
  canActivateChild(
    route: ActivatedRouteSnapshot,
    state: RouterStateSnapshot): boolean|UrlTree {
    return this.canActivate(route, state);
  }
  private isLoggedIn(): boolean|UrlTree {

    console.log('jsessionid isLoggedIn:'+sessionStorage.getItem('jsessionid'));
    if (sessionStorage.getItem('jsessionid')!=null)
    {
      console.log('jsessionid isLoggedIn:true');
      return true;}
      sessionStorage.setItem('expired','You are loggedout, please login');
    return this.router.parseUrl('\login');
    }
}export class AuthGuard implements CanActivate, CanActivateChild  {
  constructor(private authService: UserService, private router: Router) {}
  canActivate(
    next: ActivatedRouteSnapshot,
    state: RouterStateSnapshot): boolean| UrlTree {
      let url: string = state.url;

    return this.isLoggedIn();

  }
  canActivateChild(
    route: ActivatedRouteSnapshot,
    state: RouterStateSnapshot): boolean|UrlTree {
    return this.canActivate(route, state);
  }
  private isLoggedIn(): boolean|UrlTree {

    console.log('jsessionid isLoggedIn:'+sessionStorage.getItem('jsessionid'));
    if (sessionStorage.getItem('jsessionid')!=null)
    {
      console.log('jsessionid isLoggedIn:true');
      return true;}
      sessionStorage.setItem('expired','You are loggedout, please login');
    return this.router.parseUrl('\login');
    }
}
const routes: Routes = [
{ path: '',  canActivateChild: [AuthGuard],
  children: [ 
  { path: 'life-home/:id',   component: LifeHomeComponent}, 

  { path: 'profile/:id', component: ProfileComponent },
  { path: 'search/:id/:domain', component: SearchComponent },
  { path: 'user/:id/:source', component: UserComponent },
  { path: 'user/:id/:source/:type', component: UserComponent }

]},
{ path: 'login', component: LoginComponent }

]
;
@NgModule({
    imports: [ RouterModule.forRoot(routes) ],
   exports: [ RouterModule ]

})
export class AppRoutingModule { }
Oscar Flores
@oscar-stokkup
this is what i have:
// login component
 submit(){
    if (!this.loginForm.valid) {
      return;
    }
   this.authService.login(this.loginForm.value).pipe(first()).subscribe({
    next: () => {
      // get return url from route parameters or default to '/'
      const returnUrl = this.route.snapshot.queryParams['returnUrl'] || '/';
      console.log(returnUrl.toString())
      this.router.navigate(['/']);
    },
     error: error => {
       this.error = error;
       console.log('ERROR: ', this.error)
     }
   })
  }
auth guard

  canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot) {
    const currentUser = this.auth.currentUserValue
    if(currentUser){
      // logged in so return true
      console.log('testinghere')
      return true;
    }

    // not logged in so redirect to login page with the return url
    this.router.navigate(['/login'], { queryParams: { returnUrl: state.url }});
    return false;
  }
service
private currenUserSubject: BehaviorSubject<User>
  public currenUser: Observable<User>


  constructor(
    protected router: Router,
    protected session: SessionService,
    protected api: ApiService,
    private http: HttpClient
    ) {
    this.user = session.getUser();
    this.currenUserSubject = new BehaviorSubject<User>(JSON.parse(localStorage.getItem('_user')))
    this.currenUser = this.currenUserSubject.asObservable()
   }

  public isAuthenticated(): boolean {

    return (!!this.user && !!this.user.token);
  }

  public get currentUserValue(): User {
    return this.currenUserSubject.value
  }

  public login(formdata){
    let url = this.api.post('admin/login', formdata)
    return this.http.post<any>(url, formdata, { headers: this.api.headers }).pipe(
      map( user => {
        this.user = user['data'].records
        this.authToken = this.user.token
        this.session.setUser(this.user)
        return user
      })
    )
DoraRajappan
@DoraRajappan
someone will help... i ran out of time...
and your routing module?
Oscar Flores
@oscar-stokkup
routing module:
const routes: Routes = [
  {
    path: 'inventory',
    component: InventoryComponent,
    canActivate: [AuthGuard]
  },
  {
    path: 'dashboard',
    component: DashboardComponent,
    canActivate: [AuthGuard]
  },
  {
    path: '',
    redirectTo: 'dashboard',
    pathMatch: 'full',
    canActivate: [AuthGuard]
  },
  {
    path: 'login',
    component: LoginComponent

  }
];
DoraRajappan
@DoraRajappan
this is not correct
you no need to specify authgurad to every route
try something like
const routes: Routes = [
{ path: '',  canActivateChild: [AuthGuard],
  children: [ 
  { path: 'life-home/:id',   component: LifeHomeComponent}, 

  { path: 'profile/:id', component: ProfileComponent },
  { path: 'search/:id/:domain', component: SearchComponent },
  { path: 'user/:id/:source', component: UserComponent },
  { path: 'user/:id/:source/:type', component: UserComponent }

]},
{ path: 'login', component: LoginComponent }

]
;
DoraRajappan
@DoraRajappan
your dashboard mapping will have to change
Kevin W
@HiImKevin_gitlab

Hey everyone,

I added some scripts in the angular.json build scripts object. Through some console logs I'm seeing this is causing main.ts to be run multiple times (looks like once for each script). Is this the intended behavior? If not, what would cause main.ts to be run multiple times?

L Suarez
@lsuarez5280
Anyone ever have a problem installing node-sass for an Angular project where it attempts to run a Visual C++ build and bombs on issues with header descriptions in .node-gyp\12.18.4\include\node\v8.h(5531)?
There's some kind of contract mismatch and I'm not sure how to get references to the proper version into my build.
L Suarez
@lsuarez5280
I'm just gonna back out to Node 10.x and see where I land. Older program so probably a problem compiling against v12.
Oscar Flores
@oscar-stokkup

your dashboard mapping will have to change

ahh i figure it out. looks like i wasnt subscribing to the user.

ill also fix the routes ty!
Alex Okrushko
@alex-okrushko

We are close to 1500 members (including some of Angular Team members, collaborators and GDEs) at discord.gg/angular

Join us for questions and discussions :)

Sujeet Jaiswara
@sujeetjaiswara
Hi
Anyone idea about how to trigger scroll when cd-drag start with cdk-viewport-scroller ?
Gerard
@1304654_gitlab
:wave: Do you know some kind of indexeddb working witch rxjs and server side sync? Thanks!
L Suarez
@lsuarez5280
I really hate crossing the streams between my gaming and my work. Glad my employer doesn't use Discord for anything. Heh.