Last active
December 17, 2015 06:08
-
-
Save MrCoder/5562684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// create a module | |
var app = angular.module("mailbox",[]); | |
// create a directive | |
app.directive('mail', function(){ | |
console.log(app.$scope); | |
return { | |
restrict: 'E', | |
scope: { | |
subject: "@", | |
content: "=" | |
}, | |
templateUrl: 'partials/mail.html', | |
replace: true | |
}; | |
}); | |
function MailController($scope){ | |
console.log("initializing mail controller"); | |
var conversation1 = { | |
time: "3:50AM", | |
contacts: "Me, Zhong Yuan", | |
subject: "Call for service at any time.", | |
content: "Call for service at any time. Sorry to have kept you waiting....", | |
count: 20 | |
}; | |
var conversation2 = { | |
time: "5:50PM", | |
contacts: "Xiaoju, Zhong Yuan", | |
subject: "Family Day on Next Friday", | |
content: "Wa. Please make sure there are two lines of content so that \ | |
there changed....", | |
count: 20 | |
}; | |
var conversation3 = { | |
time: "5:50PM", | |
contacts: "Xiaoju, Zhong Yuan", | |
subject: "Family Day on Next Friday", | |
content: "Wa. Please make sure there are two lines of content so that \ | |
there changed....", | |
count: 2 | |
}; | |
$scope.conversations = [conversation1, conversation2, conversation3]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment