Angular directive with controller

by Alexey Ryazhskikh

JavaScript

(function() {
    'use strict';

    angular
        .module('app')
        .directive('example', ExampleDirective);

    ExampleDirective.$inject = ['$window'];
    
    function ExampleDirective ($window) {
        // Usage:
        //     <ExampleDirective></ExampleDirective>
        // Creates:
        // 
        var directive = {
            link: link,
            restrict: 'AE',
			scope: {
				val: '='
			},
			controller: ExampleDirectiveController,
            controllerAs: 'vm',
            bindToController: true
		        template: '<div class="medium-6 columns"></div>',
        };
        return directive;

        function link(scope, element, attrs) {
        }
				
    }
	
	ExampleDirectiveController.$inject = [];
	function ExampleDirectiveController() {
		
	}

})();