michaelbromley / michaelbromley/angular-es6

How to use ES6 classes to use $onChange component hook

Open
#11 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
364
Forks
59
PR merge metrics
No merged PRs in 30d

Description

I am battling getting $onChange to work (I can get $onInit to fire just fine).

Here is a portion of my ES6 class (which is my controller)

```
export default class ComplimentsController {

constructor() {
console.log('constructor')
}

$onInit() {
console.log('this fires as expected')
}

$onChange(value) {
console.log('this doesnt fire');
}

}

```

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue provides only an ES6 controller snippet and no repository file or test. Begin by tracing how the AngularJS component is registered and how its lifecycle hooks are wired, then define reproducible expected behavior for $onChange before making any change.

Written by the indexing model from the issue text.

Assessment

Tech stack
angularjs, javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.