Navigation

Saturday, August 22, 2015

AngularJS - Hello World

Hi There,

Currently I learn AngularJS and knowing very basic knowledge of AngularJS. With AngularJS, we can easily display data into HTML document with less work by adding new HTML attributes that provided by AngularJS. Yes new HTML attributes!

Off course there are lot's of feature in AngularJS, please click here to learn more detail about AngularJS.

Let's try to create Hello World apps!
  • Create new HTML project in Netbeans or your comfortable IDE and named it helloworld.
Note: In Netbeans IDE, the index.html file is automatically generated. Please create new index.html file if there's no index.html file in your helloworld project.
  • In your index.html file, please reference AngularJS library. Please see below:
<!DOCTYPE html>
<html>
    <head>
        <title>Hello world!</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
    </head>
    <body>
    </body>
</html>
Note: AngularJS library can be attach on your app by referencing the library URL into your app or you can download the AngularJS library here. If you download the library then you have to store it into your project and reference the app into that library. For example: 
  • Extend html element with new attribute called ng-app="" that provided by AngularJS. Please see below:
<!DOCTYPE html>
<html ng-app="">
    <head>
        <title>Hello world!</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
    </head>
    <body>
    </body>
</html>
  • Type Hello world text inside body tag using AngularJS expressions {{'Hello world!'}}. Please see below:
<!DOCTYPE html>
<html ng-app="">
    <head>
        <title>Hello world!</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.4/angular.min.js"></script>
    </head>
    <body>
        {{'Hello world!'}}
    </body>
</html>
  • Run your app by pressing keyboard with combination Shift+F6 buttons in Netbeans IDE
  • TARRAAA....your web browser will display Hello world text like image below.














So guys, we are successfully created an AngularJS application! Congratulation to us! Cheers...

Netbeans IDE

Hi there!

This is my daily tool to cross out my ideas into reality, it is Netbeans. Hmm.., it's a bit ambitious, isn't it? Nope, it is true, I mean Netbeans can assists you to write code in some programming languages such as HTML, CSS, Javascript, PHP and many more.

Netbeans is a great IDE (Integrated Development Environment) offers many features that are support for multiple languages, easy code editing, cross platform and many more, Hmm..., the bad news is currently I'm not using all of those features - It's my problem not you :)

Netbeans can easily integrated with many frameworks, CMS and development tools. Few things that I've tried are integrating Symfony PHP framework, Zend Framework, Wordpress and Git. It's easy and few of them currently already included in Netbeans, so you save your time.

To download this amazing IDE, Netbeans, please click here!



Netbeans IDE

Saturday, December 1, 2012

Netbeans: Read *.tpl as PHP file

Note: On this case using Netbeans PHP IDE 7.1.2 to develop web based application using PHP language.

The benefit to read *.tpl as *.php file in Netbeans is we can use fast and smart code editing. To do this just go click Tools on menu bar, Options, Miscellaneous, Files and insert these values:

  • File Extension: tpl
  • Associated File Type (MIME): PHP Files (text/x-php5)
  • Click OK
Figure 1. Configure file extension and MIME.


Open your *.tpl file and feel free to get the benefit. Oh yea, please see figure 2 and figure 3 below to see the differences.

Figure 2. Netbeans smart code editing.

Figure 3. Couldn't detect smart code editing.