Last active
July 16, 2018 10:15
-
-
Save dennis-8/e88a64a3d8cf4393bf645c9ecae398b0 to your computer and use it in GitHub Desktop.
Default binding values for AngularJS
This file contains hidden or 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
| ctrl.$onInit = function() { | |
| if (angular.isUndefined(ctrl.layout) || ctrl.layout === null) { | |
| ctrl.layout = 'column'; | |
| } | |
| } | |
| or | |
| ctrl.$onInit = function() { | |
| ctrl.layout = ctrl.layout || 'column'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment