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) {
link: link,
require: ['annotation', '?^thread', '?^threadFilter', '?^deepCount'],
scope: {
annotation: '=',
annotation: '<',
// Indicates whether this is the last reply in a thread.
isLastReply: '=',
replyCount: '=',
isLastReply: '<',
isSidebar: '<',
onReplyCountClick: '&',
isSidebar: '='
replyCount: '<',
},
templateUrl: 'annotation.html'
};
......
......@@ -20,8 +20,8 @@ module.exports = function () {
controllerAs: 'vm',
restrict: 'E',
scope: {
isDisabled: '=',
label: '=',
isDisabled: '<',
label: '<',
dropdownMenuLabel: '@',
onClick: '&',
onToggleDropdown: '&',
......
......@@ -37,7 +37,7 @@ function groupList( $window, groups, settings) {
},
restrict: 'E',
scope: {
auth: '='
auth: '<'
},
templateUrl: 'group_list.html'
};
......
......@@ -363,7 +363,7 @@ module.exports = ['$filter', '$sanitize', '$sce', '$timeout', ($filter, $sanitiz
require: '?ngModel'
restrict: 'E'
scope:
readOnly: '='
readOnly: '<'
required: '@'
templateUrl: 'markdown.html'
]
......@@ -29,9 +29,9 @@ module.exports = function () {
controllerAs: 'vm',
restrict: 'E',
scope: {
group: '=',
canPost: '=',
isShared: '=',
group: '<',
canPost: '<',
isShared: '<',
onCancel: '&',
onSave: '&',
onSetPrivacy: '&'
......
......@@ -3,11 +3,11 @@ module.exports = function () {
return {
restrict: 'E',
scope: {
filterActive: '=',
filterMatchCount: '=',
filterActive: '<',
filterMatchCount: '<',
onClearSelection: '&',
searchQuery: '=',
selectionCount: '=',
searchQuery: '<',
selectionCount: '<',
},
templateUrl: 'search_status_bar.html',
};
......
......@@ -13,7 +13,7 @@ module.exports = function () {
/**
* An object representing the current authentication status.
*/
auth: '=',
auth: '<',
/**
* Called when the user clicks on the "Sign in" text.
*/
......@@ -27,7 +27,7 @@ module.exports = function () {
*
* FIXME: should be removed when the old design is deprecated.
*/
newStyle: '=',
newStyle: '<',
},
templateUrl: 'signin_control.html',
};
......
......@@ -31,7 +31,7 @@ module.exports = ['$http', '$parse', ($http, $parse) ->
# 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
alwaysExpanded: '='
alwaysExpanded: '<'
query: '='
onSearch: '&'
onClear: '&'
......
......@@ -3,13 +3,13 @@ module.exports = function () {
restrict: 'E',
scope: {
/** The name of the currently selected sort criteria. */
sortBy: '=',
sortBy: '<',
/** A list of choices that the user can opt to sort by. */
sortOptions: '=',
sortOptions: '<',
/** If true, the menu uses just an icon, otherwise
* it displays 'Sorted by {{sortBy}}'
*/
showAsIcon: '=',
showAsIcon: '<',
/** Called when the user changes the current sort criteria. */
onChangeSortBy: '&',
},
......
......@@ -4,15 +4,15 @@ module.exports = function () {
return {
restrict: 'E',
scope: {
auth: '=',
isSidebar: '=',
auth: '<',
isSidebar: '<',
onLogin: '&',
onLogout: '&',
searchController: '=',
accountDialog: '=',
shareDialog: '=',
sortBy: '=',
sortOptions: '=',
searchController: '<',
accountDialog: '<',
shareDialog: '<',
sortBy: '<',
sortOptions: '<',
onChangeSortBy: '&',
},
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