Pergunta

What am I missing?

app.directive('summaryAddress', [function () {

    return {
        scope: {
           address: '=summary-address'
        },
        template: "<h2>Billing Address</h2>" +
            "<span>{{address.flatNumber}}</span>"
    };

}]);

The output is just...

{{address.flatNumber}}

Foi útil?

Solução

Scope mapping needs to use the normalized camel case name of the attribute and not the form that it appears in the mark up.

pobo.directive('summaryAddress', [function () {

    return {
        scope: {
            address: '=summaryAddress'
        },
        template: "<h2>Billing Address</h2>" +
            "<span>{{address.flatNumber}}</span>"
    };

}]);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top