Adding a New Blog Template In Angular JS

Categories: Angular Angular JS

Adding a New Blog Template

 

Now we will add a simple template file and test run the application before adding code to the template. Right-click the NetBeans project folder and add a new HTML page named main.html in the partials folder. Replace the generated HTML code with the code shown here:

<!-- chapter5/main.html -->

{{blogArticle}}

Right-click the project folder and select “Run” from the menu. If you set up the project correctly, the browser should open with the following text displayed: “This is a blog post about AngularJS. We will cover how to build a blog and how to add comments to the blog post.” This tells us our application is properly configured. Now we will use Twitter Bootstrap and HTML to build a menu and main page for our blog.

 

Twitter Bootstrap

 

You should have already added bootstrap.min.js to the project. If you run into JavaScript errors related to Twitter Bootstrap, you can easily replace the bootstrap.min.js file with the nonminified bootstrap.js file distributed by Twitter. Using the nonminified version of the file allows the developer to place breakpoints in the Bootstrap JavaScript file and debug any related issues. We will only cover the basics of Twitter Bootstrap here. For more documentation and tutorials on Bootstrap, see the project site.

First, we need to add three more folders and some additional Twitter Bootstrap files to the project.

We will add all the Bootstrap files here, although much of Bootstrap is not actually used in this project. Do the following:

 

1. Add a subfolder named css under the Site Root folder.

2. Add a subfolder named fonts under the Site Root folder.

3. Add a subfolder named lib-css under the Site Root folder.

4. Copy the bootstrap-theme.min.css and bootstrap.min.css files into the lib-css folder.

5. Copy the following files to the fonts folder:

a. glyphicons-halflings-regular.eot

b. glyphicons-halflings-regular.svg

c. glyphicons-halflings-regular.ttf

d. glyphicons-halflings-regular.woff

 

Top Blogs
Angular and Node JS difference Published at:- The top 5 new features of Angular did you know Published at:- Introduction to AngularJS Published at:- Single-Page Applications and Bootstrapping the Application in Angular JS Published at:- Dependency Injection and AngularJS Routes Published at:- AngularJS Templates, Views, Models, Controllers Published at:- Integrating AngularJS with Other Frameworks Published at:- Testing AngularJS Applications in the IDE Published at:- End-to-End Testing with Protractor Published at:- AngularJS Views and Bootstrap Published at:- Adding a New Blog Controller Published at:- Adding a New Blog Template In Angular JS Published at:- Ways to Communicate with REST Services Published at:- Services and Business Logic and Handling User Authentication in Angular JS Published at:- Using Basic Authentication, Creating AngularJS Services, Holding User Credentials in Angular JS Published at:- AngularJS Security : why we are covering security in a book on AngularJS Published at:- MEAN Cloud and Mobile, Local Deployment and Installing Node.js, npm, and MongoDB in Angular Published at:- Angular 4 Questions - Angular 4 Quiz (MCQ) Published at:- AngularJS MCQ Quiz Questions with Answer Part 2 Published at:- AngularJS MCQ Quiz Questions with Answer Published at:- AngularJS MCQ Quiz Questions with Answer Published at:- Angular Interview Question Set 1 Published at:- Angular Interview Question Set 2 Published at:- Angular Interview Question Set 3 Published at:- Angular Interview Question Set 4 Published at:- Angular Interview Question Set 5 Published at:- Angular Interview Question Set 7 Published at:- Angular Interview Question Set 8 Published at:- Angular Interview Question Set 9 Published at:- Angular Interview Question Set 10 Published at:- Angular Interview Question Set 11 Published at:- Angular Interview Question Set 11 Published at:- Angular Interview Question Set 12 Published at:- Angular Interview Question Set 13 Published at:- Angular Interview Question Set 14 Published at:- Angular Interview Question Set 15 Published at:- React versus Angular What Would it be advisable for You Pick Published at:- 9 Advantages of Angular you really want to be aware if you have any desire to assemble Computerized Items Published at:-
R4R.co.in Team
The content on R4R is created by expert teams.