Angular-UI Bootstrap Hello World Code Example

angularjs bootstrap
While working on several AngularJS tiny projects that are made live on my another website, I used Bootstrap to create good-looking UIs while eventing aspect was taken care by AngularJS.
Then, I came across several pages on the web which talked about using great UI-widget based framework such as ExtJS, KendoUI for laying out quick & great looking UIs and use AngularJS as an eventing framework. This is where I also got introduced to Angular-UI project ( This is when I came to know AngularJS Bootstrap components which is written by Angular-UI team. The same could be found on following page:
As a demo, take a look at the my another website, where I replaced JQuery/Bootstrap JS libraries with AngularJS Bootstrap components. I was basically using bootstrap/jquery libraries for achieving drop-down in vertical menu which I was able to accomplish with just AngularJS bootstrap components.


Why I may use AngularJS Bootstrap Components?

I went on to do quick POC and found that AngularJS bootstrap components was able to serve most of my needs without having the need to include following two JS libraries:

  • bootstrap.min.js
  • jquery.min.js

Thus, this tremendously reduced the memory footprint of overall JS files required to achieve what I wanted to achieve with my webpages.

Why I may not use AngularJS Bootstrap Components?

Primarily because, it may create a hard binding with my AngularJS code and may present difficulties if I want to explore other UI-widgeting framework in future.


HelloWorld Code Example with AngularJS Bootstrap

Pay attention to some of the following:

  • Inclusion of “ui-bootstrap-tpls-0.9.0.min.js” javascript library. Actually, there is an alternate library without “tpls” named such as “ui-bootstrap-[version].min.js”. One would want to library with name consisting of “tpls” if he/she wanted to use bootstrap-specific templates bundled with directives. This is a recommended file for people who want to take all the directives and don’t need to customize anything the solution. However, one who do want the default templates and provide their own templates, could get the file, ui-bootstrap-[version].min.js. One could download these files from
  • Inclusion of “ui.bootstrap” module when instantiating the app using code, var helloApp = angular.module( “helloApp”, [‘ui.bootstrap’] );
  • Exclusion or no dependency on jQuery or Bootstrap’s JavaScript is required.
<html ng-app="helloApp">
  <link rel="stylesheet" href="//">
  <script src="//"></script>
  <script src="ui-bootstrap-tpls-0.9.0.min.js"></script>
    var helloApp = angular.module( "helloApp", ['ui.bootstrap'] );
    helloApp.controller( "HelloCtrl", [ '$scope', function($scope) {
      $ = "calvin hobbes";

<body ng-controller="HelloCtrl">
  <div class="page-header">
    <h1>Hello World Sample Program</h1>
    <form class="form-horizontal" role="form">
      <div class="form-group">
          <label class="col-md-2 control-label">Type Your Name</label>
          <div class="col-md-4">
               <input type="text" ng-model="name"  class="form-control" value="{{name}}"/>
               <span>Hello {{ name }}!</span>


To conclude, for my sample projects, I would definitely use AngularJS Boostrap components rather than depending on Jquery & Bootstrap JS libraries.

Ajitesh Kumar
Follow me
Latest posts by Ajitesh Kumar (see all)

Ajitesh Kumar

I have been recently working in the area of Data analytics including Data Science and Machine Learning / Deep Learning. I am also passionate about different technologies including programming languages such as Java/JEE, Javascript, Python, R, Julia, etc, and technologies such as Blockchain, mobile computing, cloud-native technologies, application security, cloud computing platforms, big data, etc. For latest updates and blogs, follow us on Twitter. I would love to connect with you on Linkedin. Check out my latest book titled as First Principles Thinking: Building winning products using first principles thinking. Check out my other blog,
Posted in Javascript, UI. Tagged with , , .

Leave a Reply

Your email address will not be published. Required fields are marked *