I was reading through Ionic's source and stumbled on this part here.
fromTemplateUrl: function(url, options, _) {
var cb;
//Deprecated: allow a callback as second parameter. Now we return a promise.
if (angular.isFunction(options)) {
cb = options;
options = _;
}
return $ionicTemplateLoader.load(url).then(function(templateString) {
var modal = createModal(templateString, options || {});
cb && cb(modal);
return modal;
});
}
What's the syntax in line 10 , "cb && cb(modal);" , called and what does it do?
The conditional && is confusing me