Hi,
I get extention Switch On/Off, but i have a problema when i change application, because i can't take variable value, the value it's always the same.
controller: ["$scope", function($scope) {
function stringToBoolean(string) {
switch (string.toLowerCase()) {
case "true":
case "yes":
case "1":
return !0;
case "false":
case "no":
case "0":
case null:
return !1;
default:
return Boolean(string)
}
}
var app = qlik.currApp(),
varName = $scope.layout.props.varName;
var init = function(numTries) {
numTries || (numTries = 0), numTries > 2 || (numTries > 0 && angular.noop(),
------When arrive here, the variable value always 0.-------
app.variable.getContent(varName).then(function(reply) {
$scope.isSelected = stringToBoolean(reply.qContent.qString)
})["catch"](function(error) {
numTries++, init(numTries)
}))
};
Tks for any help!