Skip to content

Commit

Permalink
docs(Ng1Controller): Fix name of uiOnParamsChanged
Browse files Browse the repository at this point in the history
closes #2653
  • Loading branch information
christopherthielen committed Mar 30, 2016
1 parent 76ab22d commit 1d58a02
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/ng1/interface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,8 @@ export interface Ng1ViewDeclaration extends _ViewDeclaration {
*
*/
export interface Ng1Controller {
/** @hidden */
$onInit();
/**
* This callback is called when parameter values have changed.
*
Expand All @@ -439,13 +441,13 @@ export interface Ng1Controller {
* ```js
*
* angular.module('foo').controller('FancyCtrl', function() {
* this.uiOnParamsUpdated = function(newParams) {
* this.uiOnParamsChanged = function(newParams) {
* console.log("new params: ", newParams);
* }
* });
* ```
*/
uiOnParamsUpdated(newValues: any, $transition$: Transition);
uiOnParamsChanged(newValues: any, $transition$: Transition);

/**
* This callback is called when the view's state is about to be exited.
Expand Down
3 changes: 2 additions & 1 deletion src/ng1/viewDirective.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {Node} from "../path/node";
import {Param} from "../params/param";
import {kebobString} from "../common/strings";
import {HookRegOptions} from "../transition/interface";
import {Ng1Controller} from "./interface";

export type UIViewData = {
$cfg: Ng1ViewConfig;
Expand Down Expand Up @@ -381,7 +382,7 @@ function $ViewDirectiveFill ( $compile, $controller, $transitions, $view,
}

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

Expand Down

0 comments on commit 1d58a02

Please sign in to comment.