Angularjs is a very popular front-end application, nowadays each web application has two separate layers instead of a single application.
A separate layer means one front-end application which is created on the backbone, angularjs etc and another back-end application, which is created on server-side languages like php,java,.net and ruby etc.
In this post, We will learn how to convert a simple HTML template into angularjs application. I am converting the Bootstrap HTML template into an angular application using partial layout functionality.
I am taking Gentellela Admin Bootstrap Devops theme.
Gentellela Admin is a free-to-use Bootstrap admin template. This template uses the default Bootstrap 3 styles along with a variety of powerful jQuery plugins and tools to create a powerful framework for creating admin panels or back-end dashboards.
I will use ui-route
angular module to create partials view and render layout file based on route url.
You can also check other tutorial of angular,
We will create separate partial HTML template from single BOOtstrap HTML template like below,
layout.html
file<div id="navbar" class="navbar navbar-default" ui-view="header" ng-controller="layoutHeaderCtrl"></div> <div class="main-container" id="main-container"> <div id="sidebar" class="sidebar responsive" ui-view="siderbar" ng-controller="layoutSidebarCtrl"></div> <div class="main-content" ng-controller="layoutContentCtrl"> <div class="main-content-inner"> <div class="page-content"> <div ui-view=""> <h1>Welcome UI Dashboard</h1> </div> </div> </div> </div> <div class="footer" ui-view="footer"></div> <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse"> <i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i> </a> </div>
You can see above code, I am using ng-view
directive to include partial HTML files and defined controller for each files using ng-controller
.layout.html
file create whole theme template page using partials html files.
Since I am using ui-route
modules for routing angular application so i will call stateprovider
method to set state and call all partial HTML files.
$stateProvider .state('app', { url: '/app', views: { '@': { templateUrl: '/app/layout/layout.html' }, 'header@app' : { templateUrl: '/app/layout/header.html' }, 'siderbar@app' : { templateUrl: '/app/layout/sidebar.html' }, 'footer@app' : { templateUrl: '/app/layout/footer.html' } }, })
I hope its help you.
This post help to create layout of your angular application using partial HTML files.Its like other back-end framework which are providing layout functionality, so using this angular tutorial You can easily convert bootstrap HTML template into angular layout.
This tutorial helps integrate a PHP SDK with Laravel. We'll install aws-php-sdk into laravel application and access all aws services… Read More
in this quick PHP tutorial, We'll discuss php_eol with examples. PHP_EOL is a predefined constant in PHP and represents an… Read More
This Laravel tutorial helps to understand table Relationships using Elequonte ORM. We'll explore laravel table Relationships usage and best practices… Read More
We'll explore different join methods of Laravel eloquent with examples. The join helps to fetch the data from multiple database… Read More
in this Laravel tutorial, We'll explore valet, which is a development environment for macOS minimalists. It's a lightweight Laravel development… Read More
I'll go through how to use soft delete in Laravel 10 in this post. The soft deletes are a method… Read More
View Comments
can i get the download link
i can send u demo source code into ur gmail, pls send email on my phpflow@gmail.com.
can you send me your source code into my email ? my email gilang.khasani1@gmail.com
thanks :D
i have sent.
can you send me your source code into my email ?
due to privacy policy, i can't share
i ll share soon link with in this article.
hi sir,
Please provide me source code on my mail: vishal.hira.sa@gmail.com
Thanks in advance
done