{"version":"1.0","type":"rich","title":"Angular base class for if-like directives (show or hide under condition)","description":"This example demonstrates an abstract base class in Angular for building custom structural directives that show or hide template content under a condition. The code defines `AppBaseIfDirective`, which uses `ViewContainerRef` and `TemplateRef` to manage embedded views, along with protected methods `showView`, `hideView`, and `updateView` that toggle the view’s visibility. It provides reusable logic for if-like directives without binding to any specific data source. The implementation relies solely on Angular’s core APIs, with no external rendering libraries involved.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-665c4e7ea4f2933d25b60429f2712bf4?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}