New file |
0,0 → 1,108 |
<%@tag description="Body Tag Page template" pageEncoding="UTF-8"%> |
<%@attribute name="angularAppId" required="true"%> |
<%@attribute name="angularAppModules" required="false"%> |
<%@attribute name="scripts" fragment="true" %> |
|
|
|
<html> |
|
|
<body ng-app="BacoAngularApp"> |
<!-- ESTES INCLUDES NAO SE COLOCAM EM DESENVOLVIMENTO O LAYOUT DO BACO JA OS INCLUI--> |
<jsp:include page="/layout/themes/scripts-default.jsp"/> |
<jsp:include page="/layout/headerTools.jsp"/> |
|
<h2>Exemplo usando as Tags Encadeadas com Angular JS embutido</h2> |
|
|
<script> |
|
<% |
String modules = ""; |
if(angularAppModules != null) |
modules = "'" + angularAppModules + "'"; |
request.setAttribute("modules",modules); |
%> |
var nestedTagsApp = angular.module('${angularAppId}', [${modules}]); |
GLOBAL_BacoAngularAppDependencies.push('${angularAppId}'); |
|
<!-- estes codigos todos do remove e do toggle e etc's não mechi em nada limitei-me a copiar dos gajos--> |
nestedTagsApp.controller('${angularAppId}Controller', function ($scope) { |
|
|
$scope.data = [ |
{ |
"id" : 1, |
"name" : "Nao deixa fazer drag", |
"isDirectory" : true |
|
}, |
{ |
"id" : 2, |
"name" : "Nao deixa fazer drop", |
"isDirectory" : true |
}, |
{ |
"id" : 3, |
"name" : "Deixa fazer Tudo", |
"isDirectory" : true |
}, |
{ |
"id" : 4, |
"name" : "Deixa fazer Tudo e ja foi movido", |
"isDirectory" : true |
}, |
{ |
"id" : 5, |
"name" : "Exemplo de folha nao deixa abrir", |
"isDirectory" : false |
} |
]; |
$scope.testaFuncao = function(obj) |
{ |
obj.name = "Novo Nome de Teste"; |
} |
|
|
|
} |
); |
</script> |
|
<jsp:invoke fragment="scripts"/> |
|
|
<div class="container" id="${angularAppId}" ng-app="${angularAppId}" ng-controller="${angularAppId}Controller"> |
<div class="panel panel-default"> |
<div class="panel-heading"> |
Teste ao angular Embutido |
</div> |
<div class="panel-body"> |
<div class="form-horizontal" ng-repeat="obj in data" style="border: 1px solid black; margin-top: 20px"> |
<div class="form-group"> |
<label class="col-md-2 control-label">ID</label> |
<div class="col-md-4"> |
<input class="form-control" type="text" ng-model="obj.id"> |
</div> |
</div> |
<div class="form-group"> |
<label class="col-md-2 control-label">Nome</label> |
<div class="col-md-4"> |
<input class="form-control" type="text" ng-model="obj.name"> |
</div> |
</div> |
<button type="button" class="btn btn-default" ng-click="testaFuncao(obj)">Muda Nome Teste</button> |
</div> |
</div> |
</div> |
<div class="bodyTag"> |
<jsp:doBody/> |
</div> |
|
<pre> |
{{ data | json }} |
</pre> |
</div> |
</body> |
</html> |