'use strict';
define(function() {
  var ChercherModSupDirective = function($compile, $scope) {
    return {
      //templateUrl:'js/XG/biz/yamoussoukro/widgets/ChercherModSup/view/ChercherModSup.html',
      template: '<div id="cherchermodsupdirective_{{$id}}"></div>',
      scope: false,
      restrict: 'AE',
      controller: 'ChercherModSupCtrl',

      link: function($scope, elm, attrs) {
        $scope.myConfig = attrs['myConfig'];
        $scope.objectId = attrs['myObjectid'];
        $scope.compile = $compile;
        /*
        	    var update = function(){
        	    	setTimeout(function()
        	    			   {
                    	if (!$scope.ready)
                    		update();
                    	else
                    	   {
                    		var elt = document.getElementById('cherchermodsupdirective_'+$scope.$id);
                            var str = '';
                                str += "<b ng-if='config.title!=undefined' ng-show='!found' >{{config.title}}</b>";
                                str += '<div FormFieldPanelDirective ng-show="!found" ng-keypress="keyPressed($event)">';
                      	        str += '</div>';
                                str += '<button ng-click="search()"  ng-show="!found">Chercher</button>';
                                str += '<button ng-click="getSelectedObjectsFromMap()"  ng-show="!found && fieldDesc.geographic" >Sélection carte</button>';
                      	  	var cmp = $compile(str)($scope);
                      	  	angular.element(elt).append(cmp);
                    	   }
        	    			   }, 250);
                 };
                 
                 update();
                 */
      },
    };
  };

  ChercherModSupDirective.$inject = ['$compile'];
  return ChercherModSupDirective;
});
