dependencies {
...
compileOnly 'biz.aQute.bnd:biz.aQute.bndlib:4.0.0'
compileOnly 'biz.aQute.bnd:bndtools:4.0.0'
compileOnly 'biz.aQute.bnd:bndrun:4.0.0'
compileOnly 'biz.aQute.bnd:biz.aQute.remote.agent:4.0.0'
compileOnly 'biz.aQute.bnd:biz.aQute.repository.p2provider:4.0.0'
...
compile group: 'biz.aQute.bnd', name: 'biz.aQute.bnd.annotation', version: '4.0.0'
compile group: 'biz.aQute.bnd', name: 'biz.aQute.bnd.annotation.headers', version: '4.0.0'
compile group: 'biz.aQute.bnd', name: 'biz.aQute.bnd.npm', version: '4.0.0'
...
}
@Component(provide = [Ng2RestComponent.class])
public class Ng2RestComponent {
...
}
<!DOCTYPE html>
<html lang="en" ng-app="myApp">
<head>
<meta charset="UTF-8">
<title>AngularJS Example</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.7.9/angular.min.js"></script>
<script type="text/javascript" src="generated.js"></script>
</head>
<body>
<h1>AngularJS Example</h1>
<div ng-controller="Ng2RestController">
<h2>{{ message }}</h2>
<button ng-click="updateMessage()">Update Message</button>
</div>
<script>
angular.module("myApp", []).controller("Ng2RestController", function ($scope) {
$scope.message = "Hello, OSGi Enroute!";
$scope.updateMessage = function () {
$scope.message = "Updated message!";
}
});
</script>
</body>
</html>