Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created Apr 24, 2018
Embed
What would you like to do?
angular
.module("CodigosQR", ["ja.qr"])
.controller("ControladorPrincipal", ["$scope", function($scope) {
$scope.codigos = [{
codigo: "123",
mostrar: true
}, {
codigo: "Hola, mundo",
mostrar: false
}, {
codigo: "https://parzibyte.me/blog",
mostrar: true
}];
}]);
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.6/angular.min.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/janantala/angular-qr/master/lib/qrcode.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/janantala/angular-qr/master/src/angular-qr.js" type="text/javascript"></script>
<script src="script.js"></script>
</head>
<body ng-app="CodigosQR">
<div ng-controller="ControladorPrincipal">
<div ng-repeat="codigo in codigos track by $index">
<qr text="codigo.codigo" ng-show="codigo.mostrar"></qr>
<br>
<input type="checkbox" ng-model="codigo.mostrar" />
<br>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment