Template directive: onshow

This directive is used within html elements to return an attribute "hidden" if the value returned by a callback function is not empty.
onshow
Example: A sample function
  function sayHi() {
  
    return 'hi';
  
  } 
                  
The function above will be tested by the @onshow() to know if the returned value returns a non-empty value. If a non-empty value is returned, then the attribute "hidden" will be added to the html element. Since the function A sample is shown below
  <div @onshow('sayHi')>  
  
  some text here
  
  </div>
                  
These above will resolve as
  <div hidden="hidden">  
  
  some text here
  
  </div>
                  
The "hidden" attribute was added because the function returned a value that is not empty. Empty values will return an empty string. In some cases where the function supplied requires argument, we can supply the arguments after the first argument which is the function name. This is shown below
  function test($name){

    if($name == 'foo') {

      return 'some_value';

    } 

  }
                  
Testing Function
  <div @onShow('test', 'foo')> text one </div>                
  
  <div @onShow('test', '')> text two </div>                
                  
Template directive resolved as
  <div hidden="hidden"> text one </div>                
  
  <div> text two </div>