javascript

  • When you need to dispatch the event from child controller to scopes upwards you can use $scope.$emit.
  • So effectively, if a controller carries out an action, and has a new state, then, it will have to broadcast the state, and it is up to other controllers to listen to that broadcast and respond .
  • In above code controllers are showing their own value on Html and when you will click on text you will get values in console .
  • 1) For Parent- Child controller – Using $scope of parent controller to emit/broadcast events.
  • controller: function($scope) { this.publicMethodOnParentDirective = function() { // Do something } }

If I were to add another controller, DateCtrl which handed the date in a specific format back to MessageCtrl, how would one go about doing this? The DI framework seems to be concerned with XmlHttpRequests and accessing services.
Continue reading “javascript”

Learn Angularjs Online

Learn Angular.Js by Building 10 Projects  #AngularJs #webdev

  • Creating the Cars Files – Final Implementation
  • Create App With Yeoman – Implementation
  • Creating Views – Basic Design
  • Backend GET Routes – Implementation
  • Creating the Cars Files – Heavy Lifting

Learn to build AngularJS Apps and Websites from basics to advanced techniques with online Tutorial. Get trained and certified for angularjs at Eduonix online course.
Continue reading “Learn Angularjs Online”

Angular V1 Project Structure • /r/angularjs

  • Depending on how large this app is, you should be careful about switching al the controllers to components immediately, especially when you’re new at components.
  • I like to distinguish between components that are routes, components that are used on a single page, and components that are reused throughout your application.
  • I guess what I am really asking is things such as, Pages, Components, Re-useable components etc.
  • Maybe a quarter of my “directives” are using the new Angular 1.5 component syntax.
  • My understanding is that I should replace all controllers to components, use angular-ui-router to route to components instead of controllers.

Currently I have an Angular 1 Web app that is about 2 years old now utilising the old way of doing things by putting all controllers in one…
Continue reading “Angular V1 Project Structure • /r/angularjs”

Exploring Angular 1.5: Lifecycle Hooks by thoughtram

  • And a component controller is a directive controller.
  • The hook allows us to react to changes of one-way bindings of a component.
  • Lifecycle hooks in Angular landed first in the Angular 2 alpha release and they are more or less inspired by the Custom Elements lifecycle callbacks .
  • An Angular 2 component comes with lifecycle hooks like ngOnInit() , ngOnDestroy() , ngOnChanges() and many more.
  • The reference can and could be used to do DOM manipulation, even in the controller.

Angular 1.5 is finally out! This article discusses the new lifecycle hooks in Angular.
Continue reading “Exploring Angular 1.5: Lifecycle Hooks by thoughtram”

Using Angular 2 Patterns in Angular 1.x Apps

Using Angular 2 Patterns in Angular 1.x Apps course by @simpulton #angularjs

  • Initialize Angular Components with Lifecycle Hooks
  • Container and Presentation Components Using Angular Component Bindings
  • Test an Angular Component with $componentController
  • By writing our Angular 1.x application in ES6, we can create a surprising resemblance to an Angular 2 application.
  • Build an Angular Component Controller Using ES6 Class

Implementing modern component-based architecture in your new or existing Angular 1.x web application is a breath of fresh air.

In this course, you are going to take a close look at Eggly, an Angular 1.x application for organizing bookmarks, and build it using modern patterns and practices, inspired by Angular 2’s recommended architecture.

You will learn how to leverage ES6 in your Angular 1 applications through Babel, and fully understand the core patterns that are used in a composed modular web application.

This course will teach you how to leverage your existing knowledge of Angular, while preparing your mind (and applications!) for the future.

If you are interested, there is a [companion guide](http://www.angular2patterns.com/) that digs deeper into the patterns found in this course and Angular 2.

Continue reading “Using Angular 2 Patterns in Angular 1.x Apps”

Your First AngularJS App: A Comprehensive Tutorial

  • Let’s decide what we want to show in the details page.
  • You can move your model and business logic to the front-end and build back-end agnostic web apps.
  • I love Angular because of its flexibility regarding server communication.
  • I’ve decided to release it (stripped of any CSS).
  • Keep in mind that Angular is a very powerful framework and we’ve barely scratched the surface in terms of everything it has to offer.

If you haven’t tried AngularJS, you’re missing out. In this tutorial, I’ll build an Angular app from start to finish, highlighting examples of its strengths along the way.
Continue reading “Your First AngularJS App: A Comprehensive Tutorial”

JSON Web Token Tutorial: Example using AngularJS & Laravel

  • We will want to publish the package config using the following command: php artisan config:publish tymon/jwt-auth
  • JWT’s standard is still not finalized, but there won’t be any major changes there, and the libraries will adapt .
  • If I add hashing to your signup, then both signup and signin works as they should.
  • Origin ‘http://localhost:8383’ is not allowed access.
  • Origin ‘http://localhost’ is not How to fix this hosted on IIS 8.

Cookies are stale. These days there are better solutions for user authentication, which solve the headaches cookies cause with today’s mobile and single-page applications. Toptal engineer Tino Tkalec delivers this demonstration of a Laravel and Angularjs application making use of one of the best authentication methods available today: the JSON Web Token.
Continue reading “JSON Web Token Tutorial: Example using AngularJS & Laravel”