How to use the @angular/router-deprecated.Router function in @angular/router-deprecated

To help you get started, we’ve selected a few @angular/router-deprecated examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github faxad / cartify / build / item-detail / item-detail.component.js View on Github external
this.parmValue = this._routerParams.get('id');
    }
    ItemDetailComponent.prototype.ngOnInit = function () {
        var _this = this;
        this.itemService.getItem(Number(this.parmValue)).subscribe(function (item) { return _this.item = item; }, function (error) { return console.log(error); });
    };
    ItemDetailComponent.prototype.goBack = function () {
        this._router.navigate(['Items']);
    };
    ItemDetailComponent = __decorate([
        core_1.Component({
            templateUrl: 'app/item-detail/item-detail.component.html',
            providers: [item_service_1.ItemService]
        }),
        router_deprecated_1.CanActivate(function () { return angular2_jwt_1.tokenNotExpired(); }), 
        __metadata('design:paramtypes', [router_deprecated_1.RouteParams, router_deprecated_1.Router, item_service_1.ItemService])
    ], ItemDetailComponent);
    return ItemDetailComponent;
}());
exports.ItemDetailComponent = ItemDetailComponent;
github faxad / cartify / build / item-cart / item-cart.component.js View on Github external
};
    ItemCartComponent.prototype.increaseQuantity = function (item) {
        this.cartService.increaseQunatity(item).subscribe(function (items) { return console.log("Incremented"); }, function (error) { return console.log(error); });
    };
    ItemCartComponent.prototype.decreaseQunatity = function (item) {
        this.cartService.decreaseQunatity(item).subscribe(function (items) { return console.log("Decremented"); }, function (error) { return console.log(error); });
    };
    ItemCartComponent.prototype.removeItem = function (item) {
        this.cartService.removeItem(item).subscribe(function (items) { return console.log("Removed"); }, function (error) { return console.log(error); });
    };
    ItemCartComponent = __decorate([
        core_1.Component({
            templateUrl: 'app/item-cart/item-cart.component.html',
            providers: [cart_service_1.CartService]
        }), 
        __metadata('design:paramtypes', [router_deprecated_1.RouteParams, router_deprecated_1.Router, cart_service_1.CartService])
    ], ItemCartComponent);
    return ItemCartComponent;
}());
exports.ItemCartComponent = ItemCartComponent;
github faxad / cartify / build / cart / cart-item-list.component.js View on Github external
};
    ItemCartComponent.prototype.decreaseQunatity = function (item) {
        this.cart.decreaseCartItemQunatity(item).subscribe(function (items) { return console.log("Decremented"); }, function (error) { return console.log(error); });
    };
    ItemCartComponent.prototype.removeCartItem = function (item) {
        this.cart.removeCartItem(item).subscribe(function (items) { return console.log("Removed"); }, function (error) { return console.log(error); });
    };
    ItemCartComponent.prototype.goBack = function () {
        this.router.navigate(['Items']);
    };
    ItemCartComponent = __decorate([
        core_1.Component({
            templateUrl: 'app/cart/cart-item-list.component.html',
            providers: [cart_service_1.CartService, shop_service_1.ShopService]
        }), 
        __metadata('design:paramtypes', [router_deprecated_1.Router, cart_service_1.CartService])
    ], ItemCartComponent);
    return ItemCartComponent;
}());
exports.ItemCartComponent = ItemCartComponent;
github barbatus / angular2-meteor-universal / build / utils.js View on Github external
function waitRouter(compRef) {
    var injector = compRef.injector;
    var router = injector.get(router_deprecated_1.Router, router_deprecated_1.Router);
    if (router && router._currentNavigation) {
        return router._currentNavigation.then(function () { return Promise.resolve(compRef); });
    }
    return Promise.resolve(compRef);
}
exports.waitRouter = waitRouter;
github PowerShell / Phosphor / prototype / src / Phosphor-App / app / detail.component.js View on Github external
};
    DetailComponent.prototype.copyToClipboard = function () {
        window.prompt("Copy to clipboard: Ctrl+C, Enter", this.verbService.currentCommand + " " + this.grabParams());
    };
    DetailComponent.prototype.exitOutput = function () {
        document.getElementById("details").style.display = "block";
        document.getElementById("output").style.display = "none";
        this.outputShown = false;
    };
    DetailComponent = __decorate([
        core_1.Component({
            selector: 'detail-blade',
            templateUrl: 'app/html/detail.component.html',
            styleUrls: ['app/css/detail.component.css'],
        }), 
        __metadata('design:paramtypes', [router_deprecated_1.Router, collection_service_1.CollectionService, noun_service_1.NounService, http_1.Http, verb_service_1.VerbService])
    ], DetailComponent);
    return DetailComponent;
}());
exports.DetailComponent = DetailComponent;
github jumpserver / luna / luna / dist / ts / service.js View on Github external
if (this.searchrequest) {
            this.searchrequest.unsubscribe();
        }
        this.searchrequest = this.http.get('/api/search?q=' + q)
            .map(function (res) { return res.json(); })
            .subscribe(function (data) {
            _this._logger.log(data);
        }, function (err) {
            _this._logger.error(err);
        }, function () {
        });
        this._logger.log(q);
    };
    AppService = __decorate([
        core_1.Injectable(), 
        __metadata('design:paramtypes', [http_1.Http, router_deprecated_1.Router, core_2.Logger])
    ], AppService);
    return AppService;
}());
exports.AppService = AppService;
github PowerShell / Phosphor / prototype / src / Phosphor-App / app / dashboard.component.js View on Github external
//Get-Command New-Service -Syntax
    };
    DashboardComponent.prototype.updateConsole = function (command) {
        var old = document.getElementById("ps-command").innerHTML;
        document.getElementById("ps-command").innerHTML = old + '<br> <img src="./app/img/psicon.png" class="ps-icon">' + "<span>" + command + "</span>";
        //A way to quickly scroll to the bottom
        document.getElementById("ps-console").scrollTop = document.getElementById("ps-console").scrollHeight;
    };
    DashboardComponent = __decorate([
        core_1.Component({
            selector: 'my-dashboard',
            templateUrl: 'app/html/dashboard.component.html',
            styleUrls: ['app/css/dashboard.component.css'],
            directives: [noun_component_1.NounComponent, collection_component_1.CollectionComponent, detail_component_1.DetailComponent]
        }), 
        __metadata('design:paramtypes', [router_deprecated_1.Router, http_1.Http, noun_service_1.NounService, verb_service_1.VerbService])
    ], DashboardComponent);
    return DashboardComponent;
}());
exports.DashboardComponent = DashboardComponent;
github jumpserver / luna / luna / src / ts / service.js View on Github external
if (this.searchrequest) {
            this.searchrequest.unsubscribe();
        }
        this.searchrequest = this.http.get('/api/search?q=' + q)
            .map(function (res) { return res.json(); })
            .subscribe(function (data) {
            _this._logger.log(data);
        }, function (err) {
            _this._logger.error(err);
        }, function () {
        });
        this._logger.log(q);
    };
    AppService = __decorate([
        core_1.Injectable(), 
        __metadata('design:paramtypes', [http_1.Http, router_deprecated_1.Router, core_2.Logger])
    ], AppService);
    return AppService;
}());
exports.AppService = AppService;
github videogular / videogular2 / examples / build / app.js View on Github external
],
            directives: [
                router_deprecated_1.ROUTER_DIRECTIVES
            ]
        }),
        router_deprecated_1.RouteConfig([
            { path: '/single-media-player', name: 'SingleMediaPlayer', component: single_media_player_1.SingleMediaPlayer, useAsDefault: true },
            { path: '/multiple-media-player', name: 'MultipleMediaPlayer', component: multiple_media_player_1.MultipleMediaPlayer },
            { path: '/audio-player', name: 'AudioPlayer', component: audio_player_1.AudioPlayer },
            { path: '/bound-player', name: 'BoundPlayer', component: bound_player_1.BoundPlayer },
            { path: '/cue-points-player', name: 'CuePointsPlayer', component: cue_points_player_1.CuePointsPlayer },
            { path: '/video-360', name: 'Video360Player', component: video_360_player_1.Video360Player },
            { path: '/video-vr', name: 'VideoVrPlayer', component: video_vr_player_1.VideoVrPlayer },
            { path: '/**', redirectTo: ['SingleMediaPlayer'] }
        ]), 
        __metadata('design:paramtypes', [router_deprecated_1.Router, common_1.Location])
    ], VgDemo);
    return VgDemo;
}());
exports.VgDemo = VgDemo;