title: Check if attribute exists in directive
body: <p>I want to check if an attribute exists in a directive and I don't know how to do that, can anyone help? this is probably simple but I am new to angular</p>
  
  <pre><code>(function() {
  'use strict';
  
  angular.module('app').directive('home', home);
  
  var strVar="";
  strVar += "&lt;home show-text=vm.text&gt;&lt;/home&gt;" 
  
  function home() {
  return {
          restrict: 'E',
          transclude: true,
          template: strVar,
          scope: {
  
              showText: "="
          },
          controller: HomeController,
          controllerAs: 'vm',
          bindToController: true
  };
  };
  
  HomeController.$inject = ['$scope','$rootScope', '$timeout','$sce'];
  function HomeController($scope,$rootScope,$timeout,$sce) {
  if(vm.showText == “undefined”)
  {
  //Run some code
  }
  
  
  })();
  </code></pre>