2
@Component({
  selector: 'app-gender-renderer',
  template:`
        <select [(ngModel)]="selected_status" (ngModelChange) = "change_status($event)" style = "width: 100%;height: 23px;margin: 8px 0;">
        <a [routerLink]="['/monitoring-dashboard',{ outlets: { monitoring_section: ['new-page'] } }]"></a>
        <option value = "apple">Apple</option>
        <option value = "orange">Orange</option>
        <option value = "cherry">Cherry</option>
        </select>
    `
})

This is my set of code inside a render template How can i redirect to the above route on changing the drop down to orange? also need to invoke a function on all ngModelChange ?

In the function db operation is happening.... SO if selecting orange both db operation and page redirection should happen, In all other cases only db operation is needed ...

i tried with a tag, but not working ? Please help me to figure out the issue ? I searched for solution but cant figure out the actual issue...

Thank You in Advance

Sam Herrmann
  • 6,293
  • 4
  • 31
  • 50
User09111993
  • 176
  • 2
  • 14

1 Answers1

1
   this.router.navigate(['/', { outlets: { monitoring_section: [''] } }]);

This will route to the target,this code block is included in the success of db operation

User09111993
  • 176
  • 2
  • 14