i'm working on email module i'm going plug future projects. have 3 directives: have message-list directive (displays basic information from, subject , date), summary directive (clickable links display desired information (e.g. body)), , details directive (which displays full view of email).
the challenge having trying put 3 work same data via controller. want show top-level directive (the list directive) model via controller, , information model should available use in nested directive views, don't want change attributes on these nested directives.
list directive ---> summary directive(nested in list directive) --> detail directive(accessible via click event in summary directive)
this parent directive:
messagingapp.directive('messagelist', ['$log', function ($log) { 'use strict'; return { templateurl: 'directives/messagelist.tmpl.html', scope: { messages: '=', fromwho: '=', subject: '=', date: '=', details: '=', archivemessage: '=', messagestatus: '=', messagepriority: '=', markas: '&', checkpriority: '&', readmessage: '&' } }; }]); and in view, these attributes want passed through nested directives (available 3 directives):
<div ng-repeat="msg in message.allmessages> <message-list messages="msg" message-status="msg.status" message-priority="msg.priority" from-who="msg.from" subject="msg.subject" date="msg.date" details="msg.body" archive-message="archivemessage(msg)" mark-as="markas(msg)" check-priority="checkpriority(msg)" read-message="readmessage(msg)"></message-list> </div> in template directive, reference other directives.
is there easy way of doing this? apologize if poorly worded. new angular , have been researching problem quite time no luck. perhaps wording incorrectly.
thanks in advance help.
Comments
Post a Comment