質問

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}}

役に立ちましたか?

解決

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>"
    };

}]);
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top