Commit a54a689a authored by Robert Knight's avatar Robert Knight Committed by Nick Stenning

Use Angular 1.5 one-way bindings where appropriate

Angular 1.5 introduces '<' as a way of specifying
that an isolate scope property is an input (one-way) binding.
Note that this is different from '::' (one-time) bindings from
ng 1.3.

See http://angularjs.blogspot.co.uk/2016/02/angular-150-ennoblement-facilitation.html
for details.

The principle benefit is making it obvious when looking
at the definition of a component whether a property is an input
or whether it is a binding that the component might write to.
parent f76aced0
...@@ -764,12 +764,12 @@ function annotation($document) { ...@@ -764,12 +764,12 @@ function annotation($document) {
link: link, link: link,
require: ['annotation', '?^thread', '?^threadFilter', '?^deepCount'], require: ['annotation', '?^thread', '?^threadFilter', '?^deepCount'],
scope: { scope: {
annotation: '=', annotation: '<',
// Indicates whether this is the last reply in a thread. // Indicates whether this is the last reply in a thread.
isLastReply: '=', isLastReply: '<',
replyCount: '=', isSidebar: '<',
onReplyCountClick: '&', onReplyCountClick: '&',
isSidebar: '=' replyCount: '<',
}, },
templateUrl: 'annotation.html' templateUrl: 'annotation.html'
}; };
......
...@@ -20,8 +20,8 @@ module.exports = function () { ...@@ -20,8 +20,8 @@ module.exports = function () {
controllerAs: 'vm', controllerAs: 'vm',
restrict: 'E', restrict: 'E',
scope: { scope: {
isDisabled: '=', isDisabled: '<',
label: '=', label: '<',
dropdownMenuLabel: '@', dropdownMenuLabel: '@',
onClick: '&', onClick: '&',
onToggleDropdown: '&', onToggleDropdown: '&',
......
...@@ -37,7 +37,7 @@ function groupList( $window, groups, settings) { ...@@ -37,7 +37,7 @@ function groupList( $window, groups, settings) {
}, },
restrict: 'E', restrict: 'E',
scope: { scope: {
auth: '=' auth: '<'
}, },
templateUrl: 'group_list.html' templateUrl: 'group_list.html'
}; };
......
...@@ -363,7 +363,7 @@ module.exports = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitiz ...@@ -363,7 +363,7 @@ module.exports = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitiz
require: '?ngModel' require: '?ngModel'
restrict: 'E' restrict: 'E'
scope: scope:
readOnly: '=' readOnly: '<'
required: '@' required: '@'
templateUrl: 'markdown.html' templateUrl: 'markdown.html'
] ]
...@@ -29,9 +29,9 @@ module.exports = function () { ...@@ -29,9 +29,9 @@ module.exports = function () {
controllerAs: 'vm', controllerAs: 'vm',
restrict: 'E', restrict: 'E',
scope: { scope: {
group: '=', group: '<',
canPost: '=', canPost: '<',
isShared: '=', isShared: '<',
onCancel: '&', onCancel: '&',
onSave: '&', onSave: '&',
onSetPrivacy: '&' onSetPrivacy: '&'
......
...@@ -3,11 +3,11 @@ module.exports = function () { ...@@ -3,11 +3,11 @@ module.exports = function () {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
filterActive: '=', filterActive: '<',
filterMatchCount: '=', filterMatchCount: '<',
onClearSelection: '&', onClearSelection: '&',
searchQuery: '=', searchQuery: '<',
selectionCount: '=', selectionCount: '<',
}, },
templateUrl: 'search_status_bar.html', templateUrl: 'search_status_bar.html',
}; };
......
...@@ -13,7 +13,7 @@ module.exports = function () { ...@@ -13,7 +13,7 @@ module.exports = function () {
/** /**
* An object representing the current authentication status. * An object representing the current authentication status.
*/ */
auth: '=', auth: '<',
/** /**
* Called when the user clicks on the "Sign in" text. * Called when the user clicks on the "Sign in" text.
*/ */
...@@ -27,7 +27,7 @@ module.exports = function () { ...@@ -27,7 +27,7 @@ module.exports = function () {
* *
* FIXME: should be removed when the old design is deprecated. * FIXME: should be removed when the old design is deprecated.
*/ */
newStyle: '=', newStyle: '<',
}, },
templateUrl: 'signin_control.html', templateUrl: 'signin_control.html',
}; };
......
...@@ -31,7 +31,7 @@ module.exports = ['$http', '$parse', ($http, $parse) -> ...@@ -31,7 +31,7 @@ module.exports = ['$http', '$parse', ($http, $parse) ->
# regardless of whether the it is focused or has an active query. # regardless of whether the it is focused or has an active query.
# #
# If false, it is only expanded when focused or when 'query' is non-empty # If false, it is only expanded when focused or when 'query' is non-empty
alwaysExpanded: '=' alwaysExpanded: '<'
query: '=' query: '='
onSearch: '&' onSearch: '&'
onClear: '&' onClear: '&'
......
...@@ -3,13 +3,13 @@ module.exports = function () { ...@@ -3,13 +3,13 @@ module.exports = function () {
restrict: 'E', restrict: 'E',
scope: { scope: {
/** The name of the currently selected sort criteria. */ /** The name of the currently selected sort criteria. */
sortBy: '=', sortBy: '<',
/** A list of choices that the user can opt to sort by. */ /** A list of choices that the user can opt to sort by. */
sortOptions: '=', sortOptions: '<',
/** If true, the menu uses just an icon, otherwise /** If true, the menu uses just an icon, otherwise
* it displays 'Sorted by {{sortBy}}' * it displays 'Sorted by {{sortBy}}'
*/ */
showAsIcon: '=', showAsIcon: '<',
/** Called when the user changes the current sort criteria. */ /** Called when the user changes the current sort criteria. */
onChangeSortBy: '&', onChangeSortBy: '&',
}, },
......
...@@ -4,15 +4,15 @@ module.exports = function () { ...@@ -4,15 +4,15 @@ module.exports = function () {
return { return {
restrict: 'E', restrict: 'E',
scope: { scope: {
auth: '=', auth: '<',
isSidebar: '=', isSidebar: '<',
onLogin: '&', onLogin: '&',
onLogout: '&', onLogout: '&',
searchController: '=', searchController: '<',
accountDialog: '=', accountDialog: '<',
shareDialog: '=', shareDialog: '<',
sortBy: '=', sortBy: '<',
sortOptions: '=', sortOptions: '<',
onChangeSortBy: '&', onChangeSortBy: '&',
}, },
templateUrl: 'top_bar.html', templateUrl: 'top_bar.html',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment