• Как в templateUrl директивы передать параметр?

    @Sava-s
    Я в своём проекте сделал так:

    App.controller('formCtrl', ['$scope', function ($scope) {
    
        $scope.order = {
            md5hash:"036e4ab264;3253465a34535234524635f353",
            name:'Введите имя',
            phone:'Укажите свой номер',
            email:'Ваш почтовый ящик',
            address:""
        };
    
    }]).directive('formorder', [function() {
        return {
            templateUrl: 'tpl/formOrder.html',
            replace: true,
            scope:{
            },
            link: function ($scope, $element, $attrs){
                $scope.order = $scope.$parent.order;
            }
        }
    }]);

    прямая связь
    Ответ написан
    Комментировать