This file contains 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
var app = angular.module('myApp', []); | |
app.controller('MainCtrl', ['$scope', 'myService', function ($scope, myService) { | |
console.log('online'); | |
$scope.data = myService.outData; | |
$scope.showData = function () { | |
myService.showData(); | |
}; | |
}]); |
This file contains 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
app.service('myService', ['$http', '$rootScope', function ($http, $rootScope) { | |
// data private access | |
var inData = { | |
cpt: 0, | |
mytext: 'hello who ?', | |
extData: undefined | |
}; | |
var loadData = function () { | |
console.log("loadData"); |
This file contains 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
<div data-ng-controller="MainCtrl"> | |
<h1>text: {{data.text}}</h1> | |
<input type="text" data-ng-model="data.text" /> | |
<h2>nb update: {{data.cpt}}</h2> | |
<button type="button" data-ng-click="showData()">Show</button> | |
<h2>text: {{data.extData}}</h2> | |
</div> |
This file contains 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
/* | |
* http://techasite.blogspot.fr/ | |
* @author asic | |
*/ | |
print("begin javascript"); | |
print("instanciate Java ArrayList from javascript"); | |
var x = new java.util.ArrayList(4); |
This file contains 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
package test; | |
import java.io.FileNotFoundException; | |
import java.io.InputStream; | |
import java.io.InputStreamReader; | |
import java.io.Reader; | |
import javax.script.Compilable; | |
import javax.script.CompiledScript; | |
import javax.script.Invocable; |
This file contains 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
+---webapp <===== la page index et le fichier appcache sont générés à la racine | |
+---cssext <===== css externes (bootstrap ...) | |
+---cssin <===== css propre à l'application | |
+---gen <===== tous les autres fichiers générés sont dans ce répertoire | |
¦ +---js <===== contrôleur principal de l'application | |
¦ +---jsmodules <===== fichiers javascript (contrôleur et service) pour chaque entité | |
¦ +---pages <===== pages html pour chaque entité | |
¦ +---partials <===== header et footer html | |
+---img <===== images de l'application (bootstrap) | |
+---jsext <===== librairies javascript externes (jquery, bootstrap ...) |
This file contains 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
<div id="authorCreate" data-ng-controller="AuthorCreateCtrl"> | |
<h2>Author Create</h2> | |
<form class="form-horizontal"> | |
<div class="control-group"> | |
<label class="control-label" for="id">id</label> | |
<div class="controls"> |
This file contains 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
{ | |
"entities": { | |
"author": { | |
"uuid1": { | |
"firstName": "prenom", | |
"id": "1", | |
"lastName": "nom" | |
}, | |
"uuid2": {} | |
}, |
This file contains 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
bookStoreauthor.controller('AuthorDetailCtrl', ['$scope', '$location', '$routeParams', '$rootScope', 'ApiAuthor', 'ApiStorage', function ($scope, $location, $routeParams, $rootScope, ApiAuthor, ApiStorage) { | |
$rootScope.logMe("AuthorDetailCtrl"); | |
$scope.idCurrent = $routeParams.id; | |
$rootScope.logMe("get author "); | |
$scope.oneauthor = ApiAuthor.get($scope.idCurrent); | |
... |
This file contains 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
// author Controllers | |
bookStoreauthor.controller('AuthorListCtrl', ['$scope', '$location', '$routeParams', '$rootScope', 'ApiAuthor', 'ApiStorage', function ($scope, $location, $routeParams, $rootScope, ApiAuthor, ApiStorage) { | |
$rootScope.logMe("AuthorListCtrl"); | |
var self = this; | |
$scope.authors = ApiAuthor.search(); | |
$rootScope.logMe("search end"); | |
// new Author call |