angular-ui / ui-router

The de-facto solution to flexible routing with nested views in AngularJS
http://ui-router.github.io/
MIT License
13.56k stars 3.01k forks source link

AngularJs returning undefined object - Ui router Resolve Object not found. #3798

Closed medinacharlesdan closed 4 years ago

medinacharlesdan commented 4 years ago

This issue tracker is for Bug Reports and Feature Requests only.

Please direct requests for help to StackOverflow. See http://bit.ly/UIR-SOF for details.

This is a (check one box):

My version of UI-Router is: v1.0.24

Bug Report

Current Behavior:

Have seen the guide and want to resolve some data using ui-router resolve to my component by binding it. The function returns an array successfully via console.log only but returning an undefined value if not. It seems that the object inside resolve is not registered.

Expected Behavior:

Return the data.

Link to Plunker or stackblitz that reproduces the issue:

resolve : { people : function(gradesService,$transition$){ return gradesService.byScheduleDetails($transition$.params().schedule_detail_id).then(data => { return data; //return console.log(data); }); } }

//component bindings: {people: '&'},

Feature Request

(type feature request here)

General Query

Please direct general implementation questions to StackOverflow: http://stackoverflow.com/questions/ask?tags=angularjs,angular-ui-router

Please review the Sample Application which highlights common approaches: https://github.com/ui-router/sample-app-angularjs

(type general query here)

medinacharlesdan commented 4 years ago

//component bindings: {people: '<'},

Instead of using template property, use component property on state definition