Skip to content

Commit 1d58a02

Browse files
docs(Ng1Controller): Fix name of uiOnParamsChanged
closes #2653
1 parent 76ab22d commit 1d58a02

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/ng1/interface.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ export interface Ng1ViewDeclaration extends _ViewDeclaration {
419419
*
420420
*/
421421
export interface Ng1Controller {
422+
/** @hidden */
423+
$onInit();
422424
/**
423425
* This callback is called when parameter values have changed.
424426
*
@@ -439,13 +441,13 @@ export interface Ng1Controller {
439441
* ```js
440442
*
441443
* angular.module('foo').controller('FancyCtrl', function() {
442-
* this.uiOnParamsUpdated = function(newParams) {
444+
* this.uiOnParamsChanged = function(newParams) {
443445
* console.log("new params: ", newParams);
444446
* }
445447
* });
446448
* ```
447449
*/
448-
uiOnParamsUpdated(newValues: any, $transition$: Transition);
450+
uiOnParamsChanged(newValues: any, $transition$: Transition);
449451

450452
/**
451453
* This callback is called when the view's state is about to be exited.

src/ng1/viewDirective.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {Node} from "../path/node";
1414
import {Param} from "../params/param";
1515
import {kebobString} from "../common/strings";
1616
import {HookRegOptions} from "../transition/interface";
17+
import {Ng1Controller} from "./interface";
1718

1819
export type UIViewData = {
1920
$cfg: Ng1ViewConfig;
@@ -381,7 +382,7 @@ function $ViewDirectiveFill ( $compile, $controller, $transitions, $view,
381382
}
382383

383384
// TODO: move these callbacks to $view and/or `/hooks/components.ts` or something
384-
function registerControllerCallbacks($transitions: TransitionService, controllerInstance, $scope, cfg: Ng1ViewConfig) {
385+
function registerControllerCallbacks($transitions: TransitionService, controllerInstance: Ng1Controller, $scope, cfg: Ng1ViewConfig) {
385386
// Call $onInit() ASAP
386387
if (isFunction(controllerInstance.$onInit)) controllerInstance.$onInit();
387388

0 commit comments

Comments
 (0)