angularjs-migration
angularjs-migration copied to clipboard
How to get angularJs state resolve data in Angular Component ?
How to get angularJs state resolve data in Angular Component ?
here is the example how do i get currentAccount value in component ?
export default function BaseStates($stateProvider) {
$stateProvider
.state('base', {
url: '/',
abstract: true,
resolve: {
currentAccount: function() {
return 'some Data'
}
},
views: {
'appBroker@base': {
template: ' ',
}
}
});
}
@Component({
selector:'appBroker',
template:<div *ngIf="currentAccountt.owner" class="card mt-5 text-center">...</div>,
})
export class AppBrokerComponent {
constructor(){
}
}
angular.module('mySurex').directive('appBroker', downgradeComponent({ component: AppBrokerComponent }))