I am getting an error in accessing the scope variable in my html file {{model}}
In my html file
<div shipping-Detail-Directive type="billingAddress"> </div>
here is my requirement i want user to fill value in 'type' attribute and i have to access it in my ShippingDetailDirective.html file
I know that i am doing something wrong in accessing model of directive.
In my ShippingDetailDirective.html
<div class="order-content shipping-cost-confirm" ng-repeat="x in order">
<div><span>Name</span><label>:</label><span>{{x.{{model}}.firstName}} {{x.{{model}}.lastName}}</span></div>
<div><span>Company</span><label>:</label><span>{{x.{{model}}.companyName}}</span></div>
<div><span>Address</span><label>:</label><span>{{x.{{model}}.address}}</span></div>
<div><span>City</span><label>:</label><span>{{x.{{model}}.city}}</span></div>
<div><span>State / Province</span><label>:</label><span>{{x.{{model}}.state}}</span></div>
<div><span>Zip Code</span><label>:</label><span>{{x.{{model}}.zipCode}}</span></div>
<div><span>Country</span><label>:</label><span>{{x.{{model}}.country}}</span></div>
<div><span>Office Tel</span><label>:</label><span>{{x.{{model}}.officeTelephone}}</span></div>
<div><span>Home Tel</span><label>:</label><span>{{x.{{model}}.homeTelephone}}</span></div>
<div><span>Fax</span><label>:</label><span>{{x.{{model}}.fax}}</span></div>
<div><span>Mobile Phone</span><label>:</label><span>{{x.{{model}}.mobileNo}}</span></div>
<div><span>E-mail Address</span><label>:</label><span>{{x.{{model}}.email}}</span></div>
<div class="edit-forgot float-r o-view-btn">
<input type="button" ui-sref="app.Billing" value="EDIT ADDRESS" class="white-bg"></div>
</div>
and here is my directive
app.directive('shippingDetailDirective', function() {
return{
scope: {
model: '='
},
templateUrl: 'templates/ShippingDetailDirective.html',
controller: 'ShippingCtrl',
link : function (scope, elem, attrs, controller) {
scope.model = attrs.type;
}
}
});
So Can anyone please tell me that is there any other way to do this.