Contents tagged with Clean code

  • AngularJS clean code advices

    Hello everybody,

    today I want to share with you fragment of knowledge from John Papa and his course at pluralsight entitled AngularJS Patterns: Clean Code.

    Inside of course one of the videos he have following structure advice: Function, Inject, Register ( I will name it FIR  ).

    function DashBoardController(service1, service2) {//function

        //here goes code of controller.

    }

    DashBoardController.$inject = ['service1', 'service2'];//inject

    angular

        .module('app')

        .controller('DashBoardController', DashBoardController);//register

    or in the form of image:

    And as John Papa mentioned, Todd Motto also likes that approach:

    "I prefer this sequence: write my function, inject the … more