title: Working with Boolean in angular component
body: <p>I trying some hands on in angular. I tried using the same component for edit as well create product. I used an <code>if</code> statement in the component to distinguish between the edit and create. But the code inside <code>if</code> doesn't get executed when the request url is <code>http://localhost:4200/product/Edit/Redmond?edit=true</code>.  I have code to handle the route parameters. I removed it for brevity. I'm not sure what I'm missing here</p>
  <pre><code>export class ProductEditComponent implements OnInit {
  isEdit= false;
  uiProduct:ProductModel;
  ngOnInit() {
  this.activatedRoute.queryParams.subscribe(queryParams=&gt;{
    this.isEdit=queryParams['edit']      
    console.log(this.isEdit); // it's true here for the Edit Route
  })
  if (this.isEdit ==true) {      
    this.productService.
      GetProductByName(this.name)
      .subscribe((response: ProductModel) =&gt; {
        this.uiProduct = response;          
      });
  }
  }
  </code></pre>