File: click-nojquery.html

package info (click to toggle)
libjs-angular-gettext 2.3.8-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 292 kB
  • sloc: javascript: 1,596; python: 87; makefile: 17
file content (29 lines) | stat: -rw-r--r-- 1,333 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<!DOCTYPE html>
<html ng-app="myApp">
    <head>
        <title>Click test</title>
    </head>
    <body>
        <h1>Click test</h1>
        <button id="test1" translate ng-click="value = 'Success'">Test 1</button>
        <button id="test2" translate ng-click="value = 'Success'">Hello</button>
        <span id="test3" translate translate-compile>Compile <button ng-click="value = 'Success'">this</button></span>
        <span id="test4" translate>Compile <button ng-click="value = 'Failure'">this</button></span>
        <div id="field" ng-bind="value" />

        <script src="/bower_components/angular/angular.js"></script>
        <script src="/dist/angular-gettext.js"></script>
        <script>
            angular.module('myApp', ['gettext']);

            angular.module('myApp').run(function (gettextCatalog) {
                gettextCatalog.currentLanguage = 'nl';
                gettextCatalog.setStrings('nl', {
                    'Hello': 'Hallo',
                    'Compile <button ng-click="value = \'Success\'">this</button>': 'Compile <button ng-click="value = \'Success\'">dit</button>',
                    'Compile <button ng-click="value = \'Failure\'">this</button>': 'Compile <button ng-click="value = \'Failure\'">dit</button>'
                });
            });
        </script>
    </body>
</html>