Automation and testing to accelerate deployments in Azure.

Instrumenting Angular with Zone

CONTACT US TODAY

In my last post I described an open source tool from the Angular team called Zone that allows you to execute a JavaScript workflow within an execution context. I demonstrated how to instrument a sequence of asynchronous events using Zone. This is a short post to follow-up and illustrate how to do the same thing in Angular.

The first step, of course, is to Angular-ize the HTML. This is simple enough. Instead of manually binding a click function, I can use the ng-click directive, and instead of manually setting the data I can use data-binding.

 

    id=“myBtn” ng-click=“populate()”>Populate
    id=“myData”>{{data}}

 


In order to put Angular “into the Zone” we need to capture the bootstrap process. By default Angular will run and find directives to bind to, but we want to defer this step so that it runs in the context of a zone. To keep the example simple I’m not using a controller and will just set everything up on the $rootScope.

var main = function() {
    zone.marker = “main”;
    console.log(‘getting injector’);
    angular.module(‘myApp’, []).run(function($rootScope, $timeout){
        zone.marker = “module run”;
        $rootScope.populate = function() {
            zone.marker = “click”;
            $rootScope.data = “Initializing…”;
            $timeout(function() {
                zone.marker = “timeout”;
                $rootScope.data = “Done”;
  & nbsp;         }, 2000);
        };
    });
    angular.bootstrap(document, [‘myApp’]);
};

That’s really it. This should look very similar to the previous example. Note that besides the zone “markers” I set up to make the console output more readable, there is nothing that changes in the Angular code itself – everything is handled by virtue of it being run from within a zone. The zone is fired up the same way as the previous example:

zone.fork(profilingZone).run(function() {
    zone.reset();
    main();
});

When it’s run you can see we get a sequential profile of the asynchronous events … for example, notice the time elapsed between the last two is almost exactly 2 seconds or the interval that I set using Angular’s $timeout service.

Entered task
Exited task module run after 22.999999986495823
Total active time: 22.999999986495823
Total elapsed time: 22.999999986495823
Entered task
Exited task click after 3.9999999571591616
Total active time: 26.999999943654984
Total elapsed time: 4333.999999973457
Entered task
Exited task timeout after 0.9999999892897904
Total active time: 27.999999932944775
Total elapsed time: 6333.999999973457

The full fiddle for this example is here. I included the Zone source because I’m not aware of a CDN for it yet.

Work at the Speed of Ideas in Azure.

We are not short on ideas and increasingly businesses want to implement them as quickly as possible.
This is putting a burden on development teams to accelerate development without sacrificing quality.

We developed a best of breed platform designed specifically for Azure to enable end-to-end automation and testing.
Our service accelerates the deployment of e-commerce sites, corporate websites and portals, and mobile web applications.
Customers get to improve time-to-revenue with a reliable, predictable, and repeatable delivery platform.

Consistent through stages.

Version and release control.

Accelerate time-to-market.

We enable your teams to work in a logical and linear progression from inception to reality.

The platform is designed to facilitate a continuous delivery cycle using Agile methodologies.

You will streamline all aspects from identifying problems, rolling back to known good versions, and deploying at anytime of the day.

The Problem with Release Management.

The need to release faster and better quality is growing quickly. The inability to keep up with changing demand can be especially challenging for e-tailers who compete for customer mind-share. The need to move faster and faster results on more possibility of errors. With web development a common symptom of errors are broken links resulting from:

  • Renaming or moving a webpage and forgetting to change the internal link
  • Linking to content (documents, videos, forms, etc.) that has been moved or deleted
  • Linking to external pages where the URL changed or the page moved

Broken links impact Search Engine Optimization (SEO) which can easily reduce traffic to a site. More importantly, broken links have a direct impact on reputation, customer confidence, and completing a transaction. Broken links are a simple example of a very visible break down in testing and proper release management processes.

This is where automation and testing can become a catalyst to business but it is not as easy as it looks:

  • The tools to improve release management are complex, multi-origin, and rapidly changing
  • Not all are platform certified for public clouds such as Azure and can be unwieldy to deploy

As a result, many cut corners – they skip automation and don’t leverage testing, sometimes forgoing it altogether.

Request a Conversation

Put an End to Release Headaches.

We built this service for companies, e-tailers, and web development agencies who demand a better solution to ensure rapid development of content and features. It is ideally suited for automating the release and testing process for a Content Management System (CMS). Users benefit from the ability to:

  • Develop new features and capabilities faster and ensure they will not break the site or application as code gets promoted:
    • Linking to content (documents, videos, forms, etc.) that has been moved or deleted
    • Rapid corrective actions when functionality breaks
    • Event actions by trained experts using runbooks and/or automation
  • Reduce manual quality control (QC) processes:
    • Addresses the reality that most companies do not hire for this and often skip it
    • Catches bad code before it breaks or reduces functionality for live sites and applications
    • Key-based copying of databases from production to staging, test, and development without interrupting live environments
  • Evolve test coverage over time through an on-going consultative process:
    • As new functionality gets deployed, integrate as part of the automated testing plan
  • Manage code promotion across distributed locations:
    • Supports a centralized development model, allowing promotion of code to multiple production environments and across geo-distributed locations when required
    • As new functionality gets deployed, integrate as part of the automated testing plan

A Best of Breed Platform for Azure.

The Atmosera Release Management as a Service was developed to address the gap which exists for companies and developers wanting to move quickly through release management while ensuring quality control and repeatable testing procedures. The platform was purpose-built for Azure using productized integration code to seamlessly connect industry-leading products including:

  • Chef: infrastructure automation
  • Bitbucket: web-based projects hosting
  • Terraform: infrastructure as code
  • JIRA: bug tracking and project management
  • Jenkins: continuous integration and delivery management
  • Zabbix: real-time monitoring
  • Selenium: web application testing

Focus on your business and deploying the next release, not the infrastructure on which your automation and testing runs. Say goodbye to errors such as broken links!

Benefit from a Platform Based on DevOps Practices.

Agile and DevOps are all the rage but is your IT really enabling them properly?

Atmosera Release Management as a Service is a foundational platform on top of which your teams can drive better agility and quality. It was built for developers to ensure a framework where both infrastructure and operation are harmonized to deliver the ability to:

  • Track every change for every version and quickly find the source of a problem within your application
  • Leverage a structure which enables you to easily roll back to previous known good versions.
  • Log application feedback and add it to a backlog which can be prioritized for the planning phase of a future version.
  • Drive Continuous Integration (CI) which means you can deploy your application at any time without fear of losing data, customers, or other services related to your application.
  • Enable Continuous Deployment (CD) which allows your team to work effectively on an application with less downtime due to disruptions and distractions.
  • Put an end to the need to schedule software releases at 2AM on a Saturday.

We deliver solutions that accelerate the value of Azure.

Ready to experience the full power of Microsoft Azure?

Start Today

Blog Home

Stay Connected

Upcoming Events

All Events