-->

Thursday, November 28, 2024

I am starting my programming journey again today

I am starting my programming journey again today. Over the past few days, I have completed many practical exercises.




I enjoyed working with Angular programming the most, which is why I have changed the name of my old domain to ng-build.com. If you have been following me for a while, I want to share that you'll really enjoy working with AngularJS. Angular is a single-page application framework that involves asynchronous calls.


Angular has now been optimized to design even faster and more robust applications. It now offers lazy loading components, which allow you to render only the libraries you are using. Previously, Angular used a single module file that would load all components and libraries together, but that's no longer the case.


Now, the structure of our components has evolved as follows.


import { Component } from '@angular/core';

import { CommonModule } from '@angular/common';


@Component({

  selector: 'app-standalone',

  templateUrl: './standalone.component.html',

  standalone: true,

  imports: [CommonModule]

})

export class StandaloneComponent {

  // Component logic here

}

Friday, May 13, 2016

Open New Browser Tab using AngularJS

In this article, I will show you, How to open new browser tab using ng-click event. This is the same thing in JQuery. In this example, first of all access division tag using angular,module function. In this we have ng-app as parameter. Lets see the example.

<!DOCTYPE html>
<html>
<head>
    <title></title>
</head>
<body>
   <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.9/angular.min.js"></script>
   <script type="text/javascript">
       var app = angular.module('FirstApp', [])
       app.controller('ControllerPage', function ($scope, $window) {
           $scope.NewTab = function () {
               $window.open("https://dotprogramming.blogspot.com");
           }
       });
    </script>
    <div ng-app="FirstApp" ng-controller="ControllerPage">
        <input type="button" value="New Tab" ng-click="NewTab()" />
    </div>
</body>
</html>
© Copyright 2013 Computer Programming | All Right Reserved