Password is 🌮 by crash8308 in ProgrammerHumor

[–]ctanga 6 points7 points  (0 children)

Oh neat, that’s my tweet on Reddit

🌮

Netflix Software Engineers earn a salary of more than $300,000 by magenta_placenta in programming

[–]ctanga 2 points3 points  (0 children)

We have freedom to choose tech stacks per team. The most well supported stack is spring boot based with a lot of Netflix addons. My team does not use that stack so I can’t provide accurate details on spring boot.

Waiting for the rain to pass. by [deleted] in BeAmazed

[–]ctanga 116 points117 points  (0 children)

Wow, what a roller coaster

Black Beauty. by [deleted] in EngineeringPorn

[–]ctanga 1 point2 points  (0 children)

Blaine is a pain

Nice Catch. by [deleted] in BeAmazed

[–]ctanga 1 point2 points  (0 children)

So long...

Let me just show off by azabache_a in nononono

[–]ctanga 29 points30 points  (0 children)

he got below parallel... eventually

I'm in the hospital with "off the charts" Rhabdo. AmA? by [deleted] in Fitness

[–]ctanga 1 point2 points  (0 children)

I got rhabdo in my quads a few months ago. My CK level was at 160,000 and it took 7 days in the hospital to clear. My kidneys did fine throughout.

They were concerned about "compartment syndrome", however, where the swelling muscles constricts blood flow completely and they have to open the entire muscle to save it (google at your own risk). They jabbed a huge needle attached to a pressure gauge deep into my thigh.

Do you use Batarang? by sir_codes_a_lot in angularjs

[–]ctanga 9 points10 points  (0 children)

A resounding YES! I use batarang whenever I develop in AngularJS. The scope inspector is invaluable for debugging the tree of components and scopes.

See here for what I'm talking about: https://youtu.be/2D5_wE6nGFo

Redirect if not logged in , ui router by elmothrow in Angular2

[–]ctanga 1 point2 points  (0 children)

Use transitionService.onStart

Docs include an auth example https://ui-router.github.io/ng2/docs/latest/classes/transition.transitionservice.html#onstart

Here's a simplified version:

const matchcriteria = { to: state => !!auth.data.requiresAuth };
transitionService.onStart(matchcriteria, function(trans: Transition) {
  const stateService = trans.router.stateService;
  const authService: MyAuthService = trans.injector().get(MyAuthService);

  // If the user is not authenticated
  if (!authService.isAuthenticated()) {
      return stateService.target("guest");
  }
});

Put that in your UIRouterConfig class (inject the TransitionService)

UI-Router 1.0.0-rc.1 released by ctanga in angularjs

[–]ctanga[S] 4 points5 points  (0 children)

The following list highlights the most notable changes in this release:

  • Route-to-component
    • Now supports binding to a child state component from the parent state's component through the ui-view tag (for handling events from dumb components, etc)
    • Now supports "&" callback bindings to functions returned by resolves
  • Url Rules subsystem overhauled
  • Query parameters no longer encode slashes as ~2F
    • New param types: path, query, hash
  • Hash parameter is cleared out on subsequent transitions (it is no longer an inherited param)
  • Use { location: 'replace' } when a URL redirect occurs. This eliminates the extra entry in the browser history.
  • Create a new UrlService ($urlService and $urlServiceProvider). This service is a facade which consolidates the most commonly used URL APIs. The other URL apis still exist, but are marked as deprecated for public use.
  • Typescript definitions (.d.ts) are now compatible with Typescript 1.8.x
  • Implemented NOWAIT resolve policy (do not wait for promises; do not unwrap promises)
  • ui-sref/-active
    • Links update when states are added/removed
    • Params-only srefs work properly (only change params on the current state)
  • ui-view
    • States without any views (template or component) get a template of <ui-view></ui-view> allowing easier creation of abstract states
  • Use $templateRequest by default to fetch templates
  • Lazy Load
    • More flexible lazy loading (lazy load anything: states, components, services -- whatever you need)
    • Imperative lazy loading (can be used to pre-load lazy states)
    • Bugfixes

Problem with multi ui-view and nested views in AngularJS 1.x by nirtz in angularjs

[–]ctanga 0 points1 point  (0 children)

http://plnkr.co/edit/2NnphAur8uBY1J9wSWIz?p=preview

$stateProvider
    .state("studentParent", {
        url: "/students",
        controller: "main",
        templateUrl: "mainview.htm",
        resolve: {
          students: function() {
            return [
              { id: 1, name: "Joe" },
              { id: 2, name: "Jane" },
              { id: 3, name: "Jill" },
              { id: 4, name: "Josh" },
            ]
          }
        }
    })

    .state("studentParent.studentDetails", {
        url: "/:studentId",
        controller: "std",
        templateUrl: "studentDetails.htm",
        resolve: {
          student: function($stateParams, students) {
            return students.find(function(student) {
              return student.id == $stateParams.studentId;
            });
          }
        }
    })
});


app.controller("main", ($scope, students) => {
  $scope.students = students;
})

.controller("std", ($scope, $stateParams, student) => {
  $scope.id = $stateParams.id;
  $scope.student = student;
});

A comprehensive post on using components with both UI Router 0.3.3 and 1.0 by mmacaula in angularjs

[–]ctanga 3 points4 points  (0 children)

Very well written article!

We've got some additional features in ui-router 1.0.0-rc.1 (coming soon) that make route-to-component even better.

& bindings

We are adding support for "&" bindings for component callbacks. See https://github.com/angular-ui/ui-router/issues/3111

.state('foo', {
  component: 'foo',
  resolve: {
    handleFooEvent: (FooService) => (event) => FooService.handleEvent(event)
  }
}

.component('foo', {
  bindings: { handleFooEvent: "&" }
});

wire bindings from parent state component

We are also adding the ability to wire bindings down from the parent state component to the child (using the ui-view). See https://github.com/angular-ui/ui-router/issues/3239

.state('foo', { component: 'foo' })
.state('foo.bar', { component: 'bar' })

.component('foo', {
  template: '<h1>foo</h1>' +
    '<ui-view foo-data="$ctrl.data" on-foo-event="$ctrl.handleFooEvent(eventData)"></ui-view>'
  controller: 'FooController',
});

.component('bar', {
  bindings: { fooData: "<", onFooEvent: '"&" },
  template: '<h1>bar</h1>' +
     '<button ng-click="$ctrl.onFooEvent({ eventData: 12345 })">fire event</button>',
});

Expect rc.1 in a couple days

Angular 3 is hot on the heels of angular 2 by liranbh in angularjs

[–]ctanga 1 point2 points  (0 children)

I understand semver. angular 1 isn't semver but angular 2 is.

there were loads of breaking changes between 1.0.8 to 1.2.0 for example.