Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9248707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:00:23+00:00 2026-06-18T10:00:23+00:00

I am studying the Localization example at the bottom of AngularJS home page. I

  • 0

I am studying the Localization example at the bottom of AngularJS home page.

I am looking at the source of the page and try to do exactly what the demo shows me.

However, I can’t seem to fire up the demo code. The lines that confused me the most are:

   <span class="pull-right" 
    js-fiddle="tabs.html components.js beers.js" module="components"> ...
   <div app-run="tabs.html" module="components-us" class="well"> ...

Because I don’t recognise app-run or js-fiddle to be AngularJS syntax (or is it?). Anyway, the demo app doesn’t fire up. Could you please help me take a look?

Here is the code I COPY & PASTE from AngularJS home page and put in index.html: (change the header base and libraries to your directory accordingly)

index.html

<!doctype html>
<html ng-app>
    <head>
        <meta charset="utf-8">
        <!-- ************IMPORTANT !! change this to your directory************ -->
        <base href='http://localhost/angularjs/localization/' />
        <link rel="stylesheet" href="../bootstrap/css/bootstrap.css">
        <script src="../bootstrap/js/bootstrap.js"></script>
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.0.4/angular.min.js"></script>
    </head>
    <body>

    <div class=" row example">
        <div class="span1 app-source" app-source="tabs.html components.js beers.js" annotate="tabs.annotation" module="components"></div>
        <div class="span4">
            <span hint></span>
            <span class="pull-right" js-fiddle="tabs.html components.js beers.js" module="components"></span>
            <div class="tabs-spacer"></div>
            <h4>Locale: {{ 'US' }}</h4>
            <div app-run="tabs.html" module="components-us" class="well"></div>
            <div class="tabs-spacer"></div>
            <h4>Locale: {{ 'SK' }}</h4>
            <div app-run="tabs.html" module="components-sk" class="well"></div>
        </div>
    </div>

    <script>
        angular.module('components-us', ['components', 'ngLocal.us']);
        angular.module('components-sk', ['components', 'ngLocal.sk']);
    </script>

    <script type="text/ng-template" id="tabs.html">
        <tabs>
            <pane title="Localization">
                Date: {{ '2012-04-01' | date:'fullDate' }} <br>
                Currency: {{ 123456 | currency }} <br>
                Number: {{ 98765.4321 | number }} <br>
            </pane>
            <pane title="Pluralization">
                <div ng-controller="BeerCounter">
                    <div ng-repeat="beerCount in beers">
                        <ng-pluralize count="beerCount" when="beerForms"></ng-pluralize>
                    </div>
                </div>
            </pane>
        </tabs>
    </script>

    <script id="beers.js">
        function BeerCounter($scope, $locale) {
            $scope.beers = [0, 1, 2, 3, 4, 5, 6];
            if ($locale.id == 'en-us') {
                $scope.beerForms = {
                    0: 'no beers',
                    one: '{} beer',
                    other: '{} beers'
                };
            } else {
                $scope.beerForms = {
                    0: 'žiadne pivo',
                    one: '{} pivo',
                    few: '{} pivá',
                    other: '{} pív'
                };
            }
        }
    </script>

    <script id="components.js">
        angular.module('components', []).
                directive('tabs', function() {
                    return {
                        restrict: 'E',
                        transclude: true,
                        scope: {},
                        controller: function($scope, $element) {
                            var panes = $scope.panes = [];

                            $scope.select = function(pane) {
                                angular.forEach(panes, function(pane) {
                                    pane.selected = false;
                                });
                                pane.selected = true;
                            }

                            this.addPane = function(pane) {
                                if (panes.length == 0) $scope.select(pane);
                                panes.push(pane);
                            }
                        },
                        template:
                                '<div class="tabbable">' +
                                        '<ul class="nav nav-tabs">' +
                                        '<li ng-repeat="pane in panes" ng-class="{active:pane.selected}">'+
                                        '<a href="" ng-click="select(pane)">{{pane.title}}</a>' +
                                        '</li>' +
                                        '</ul>' +
                                        '<div class="tab-content" ng-transclude></div>' +
                                        '</div>',
                        replace: true
                    };
                }).
                directive('pane', function() {
                    return {
                        require: '^tabs',
                        restrict: 'E',
                        transclude: true,
                        scope: { title: '@' },
                        link: function(scope, element, attrs, tabsCtrl) {
                            tabsCtrl.addPane(scope);
                        },
                        template:
                                '<div class="tab-pane" ng-class="{active: selected}" ng-transclude>' +
                                        '</div>',
                        replace: true
                    };
                })
    </script>

   </body>
</html>

Also, where are app-run and js-fiddle from? I can’t figure out if they are features belong to AngularJS or what.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:00:24+00:00Added an answer on June 18, 2026 at 10:00 am

    app-run and js-fiddle are custom Angular directives — i.e., directives they wrote to help run the AngularJS home page (hence the reason they are in the file aptly named homepage.js).

    Here is a working plnkr of the demo.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After studying TCP/UDP difference all week, I just can't decide which to use. I
While studying for the 70-433 exam I noticed you can create a covering index
When studying the project 'gproc' source code files, I have found several patch files
Studying some sources I often came to see this: (Part of the real source)
I studying NSCharacterset class. NSString and NSCharacterset look like similar class. Who can explain
I am studying 'Web Service' this week and found good tutorial and example code.
while studying some security things, there was a question that one can guess the
Just studying data structures in python for a project and can't work out the
Studying vision, I would like to play with the Microsoft Kinect. Can I use
After studying the member copying and the assignment operator in C++, and looking at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.