How to use the @angular/router-deprecated.ROUTER_DIRECTIVES 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 jumpserver / luna / luna / dist / ts / nav.js View on Github external
title: 'Please Input Code',
            scrollbar: false,
            area: ['400px', '300px'],
            moveOut: true,
            moveType: 1
        }, function (value, index) {
            service_1.DataStore.socket.emit('key', value);
            // layer.msg(value); //得到value
            layer.close(index);
        });
    };
    NavComponent = __decorate([
        core_1.Component({
            selector: 'nav',
            template: "<div class="\&quot;nav\&quot;">\n    <ul>\n        <li><a><img height="\&quot;26px\&quot;/" src="\&quot;./imgs/logo.png\&quot;"></a>\n        </li>\n        <li k="index">\n            <a>{{v.name}}</a>\n            <ul>\n                <li>\n                    <a>{{vv.name}}</a>\n                    <a id="\&quot;{{vv.id}}\&quot;">{{vv.name}}</a>\n                </li>\n            </ul>\n        </li>\n    </ul>\n</div>",
            directives: [router_deprecated_1.ROUTER_DIRECTIVES, common_1.NgClass]
        }), 
        __metadata('design:paramtypes', [service_1.AppService, core_2.Logger])
    ], NavComponent);
    return NavComponent;
}());
exports.NavComponent = NavComponent;
github Cecildt / angular2-O365-desktop-app / src / app / app.js View on Github external
});
        // route the user to a view based on presence of access token
        if (auth.isUserAuthenticated) {
            // access token exists...display the users files
            router.navigate(["/Home"]);
        }
        else {
            // access token doesn't exist, so the user needs to login
            router.navigate(["/Login"]);
        }
    }
    App = __decorate([
        core_1.Component({
            selector: "graph-app",
            templateUrl: __dirname + "/view-main.html",
            directives: [router_deprecated_1.ROUTER_DIRECTIVES, profile_1.Profile]
        }),
        router_deprecated_1.RouteConfig([
            { name: "Default", path: "", redirectTo: ["Login"] },
            { name: "Home", component: home_1.Home, path: "/home" },
            { name: "Login", component: login_1.Login, path: "/login" },
            { name: "Files", component: files_1.Files, path: "/files" },
            { name: "Groups", component: groups_1.Groups, path: "/groups" },
            { name: "Contacts", component: contacts_1.Contacts, path: "/contacts" },
            { name: "Mails", component: mails_1.Mails, path: "/mails" },
            { name: "Notes", component: notes_1.Notes, path: "/notes" },
            { name: "Tasks", component: tasks_1.Tasks, path: "/tasks" },
            { name: "Trending", component: trending_1.Trending, path: "/trending" },
            { name: "Users", component: users_1.Users, path: "/users" },
        ]), 
        __metadata('design:paramtypes', [http_1.Http, router_deprecated_1.Router, authHelper_1.AuthHelper])
    ], App);
github faxad / cartify / build / item-list / item-list.component.js View on Github external
};
    ItemListComponent.prototype.onRatingClicked = function (message) {
        this.pageTitle = 'Item List: ' + message;
    };
    ItemListComponent.prototype.addItemToCart = function (item) {
        this.cart.itemExists(item, function (service, item) {
            service.addItem(item).subscribe(function (items) { return console.log("Added to Cart"); }, function (error) { return console.log(error); });
        });
    };
    ItemListComponent = __decorate([
        core_1.Component({
            selector: 'list-item',
            templateUrl: 'app/item-list/item-list.component.html',
            styleUrls: ['app/item-list/item-list.component.css'],
            pipes: [item_filter_pipe_1.ItemFilterPipe],
            directives: [star_component_1.StarComponent, form_component_1.FormComponent, router_deprecated_1.ROUTER_DIRECTIVES],
            providers: [item_service_1.ItemService, cart_service_1.CartService]
        }), 
        __metadata('design:paramtypes', [item_service_1.ItemService, auth_service_1.AuthService, (typeof (_a = typeof cart_service_1.CartService !== 'undefined' && cart_service_1.CartService) === 'function' && _a) || Object])
    ], ItemListComponent);
    return ItemListComponent;
    var _a;
}());
exports.ItemListComponent = ItemListComponent;
github chsakell / aspnet5-angular2-typescript / src / PhotoGallery / wwwroot / app / app.js View on Github external
return _user.Username;
        }
        else
            return 'Account';
    };
    AppRoot.prototype.logout = function () {
        this.membershipService.logout()
            .subscribe(function (res) {
            localStorage.removeItem('user');
        }, function (error) { return console.error('Error: ' + error); }, function () { });
    };
    AppRoot = __decorate([
        core_1.Component({
            selector: 'photogallery-app',
            templateUrl: './app/app.html',
            directives: [router_deprecated_1.ROUTER_DIRECTIVES, common_1.CORE_DIRECTIVES]
        }),
        router_deprecated_1.RouteConfig(routes_1.APP_ROUTES), 
        __metadata('design:paramtypes', [membershipService_1.MembershipService, common_2.Location])
    ], AppRoot);
    return AppRoot;
}());
exports.AppRoot = AppRoot;
github faxad / cartify / build / shop / shop-item-list / shop-item-list.component.js View on Github external
}
            _this.getShopItems(true);
        }, function (error) { return console.log(error); });
    };
    ShopItemListComponent.prototype.addToCart = function (item) {
        this.cart.itemExists(item, function (service, item) {
            service.addItem(item).subscribe(function (items) { return console.log("Added to Cart"); }, function (error) { return console.log(error); });
        });
    };
    ShopItemListComponent = __decorate([
        core_1.Component({
            selector: 'list-item',
            templateUrl: 'app/shop/shop-item-list/shop-item-list.component.html',
            styleUrls: ['app/shop/shop-item-list/shop-item-list.component.css'],
            pipes: [shop_item_filter_pipe_1.ItemFilterPipe],
            directives: [shop_item_form_component_1.FormComponent, router_deprecated_1.ROUTER_DIRECTIVES],
            providers: [shop_service_1.ShopService, cart_service_1.CartService]
        }), 
        __metadata('design:paramtypes', [shop_service_1.ShopService, auth_service_1.AuthService, cart_service_1.CartService])
    ], ShopItemListComponent);
    return ShopItemListComponent;
}());
exports.ShopItemListComponent = ShopItemListComponent;
github PowerShell / Phosphor / prototype / src / Phosphor-App / app / app.component.js View on Github external
var AppComponent = (function () {
    function AppComponent() {
        this.title = 'Phosphor';
    }
    AppComponent = __decorate([
        core_1.Component({
            selector: 'my-app',
            template: "\n    \n  ",
            styleUrls: ['app/css/app.component.css'],
            directives: [router_deprecated_1.ROUTER_DIRECTIVES],
            providers: [
                router_deprecated_1.ROUTER_PROVIDERS,
            ]
        }),
        router_deprecated_1.RouteConfig([
            {
                path: '/',
                name: 'Dashboard',
                component: dashboard_component_1.DashboardComponent,
                useAsDefault: true
            }
        ]), 
        __metadata('design:paramtypes', [])
    ], AppComponent);
    return AppComponent;
}());
github jumpserver / luna / luna / dist / ts / index.js View on Github external
var AppComponent = (function () {
    function AppComponent() {
        this.DataStore = service_1.DataStore;
    }
    AppComponent = __decorate([
        core_1.Component({
            selector: 'body',
            template: "<nav></nav>\n<span style="\&quot;display:none\&quot;" id="\&quot;liuzheng\&quot;">liuzheng</span>\n",
            directives: [nav_1.NavComponent, router_deprecated_1.ROUTER_DIRECTIVES],
            providers: [service_1.AppService, router_deprecated_1.ROUTER_PROVIDERS]
        }),
        router_deprecated_1.RouteConfig([
            { path: '/login', name: 'Login', component: login_1.LoginComponent },
            { path: '/', name: 'Index', component: IndexComponent },
            { path: '/aaa', name: 'Aaaa', component: IndexComponent },
            { path: '/bifrost', name: 'WorkboardComponent', component: WorkboardComponent },
            { path: '/hostedit', name: 'HostEdit', component: hostedit_1.HostEditComponent },
        ]), 
        __metadata('design:paramtypes', [])
    ], AppComponent);
    return AppComponent;
}());
exports.AppComponent = AppComponent;
github faxad / cartify / build / app.component.js View on Github external
var AppComponent = (function () {
    function AppComponent(auth) {
        this.auth = auth;
    }
    AppComponent.prototype.login = function () {
        this.auth.login();
    };
    AppComponent = __decorate([
        core_1.Component({
            selector: 'app-content',
            directives: [router_deprecated_1.ROUTER_DIRECTIVES, shop_item_list_component_1.ShopItemListComponent, cart_item_list_component_1.ItemCartComponent],
            providers: [router_deprecated_1.ROUTER_PROVIDERS, http_1.HTTP_PROVIDERS, auth_service_1.AuthService],
            template: "\n\t\t<nav class="\&quot;navbar">\n\t      <div class="\&quot;container\&quot;">\n\t        <div class="\&quot;navbar-header\&quot;">\n\t          <button aria-controls="\&quot;navbar\&quot;" aria-expanded="\&quot;false\&quot;" data-target="\&quot;#navbar\&quot;" data-toggle="\&quot;collapse\&quot;" class="\&quot;navbar-toggle" type="\&quot;button\&quot;">\n\t            <span class="\&quot;sr-only\&quot;">Toggle navigation</span>\n\t            <span class="\&quot;icon-bar\&quot;"></span>\n\t            <span class="\&quot;icon-bar\&quot;"></span>\n\t            <span class="\&quot;icon-bar\&quot;"></span>\n\t          </button>\n\t          <a href="\&quot;#\&quot;" class="\&quot;navbar-brand\&quot;">\n\t          \t<span aria-hidden="\&quot;true\&quot;" class="\&quot;glyphicon">Cartify</span>\n\t          </a>\n\t        </div>\n\t        <div class="\&quot;navbar-collapse" id="\&quot;navbar\&quot;">\n\t          <form class="\&quot;navbar-form">\n\t            <button class="\&quot;btn">\n\t            <span aria-hidden="\&quot;true\&quot;" class="\&quot;glyphicon"></span> Sign In\n\t            </button>\n\t            <button class="\&quot;btn">\n\t            <span aria-hidden="\&quot;true\&quot;" class="\&quot;glyphicon"></span> Sign Out\n\t            </button>\n\t          </form>\n\t        </div>\n\t      </div>\n\t    </nav>\n\t    <div class="\&quot;container\&quot;">\n\t    \t<div class="\&quot;starter-template\&quot;">\n\t    \t\t<br><br><br>\n\t    \t\t\n\t    \t</div>\n\t    </div>\n\t",
        }),
        router_deprecated_1.RouteConfig([
            { path: '/items', name: 'Items', component: shop_item_list_component_1.ShopItemListComponent, useAsDefault: true },
            { path: '/item/:id', name: 'Detail', component: shop_item_detail_component_1.ShopItemDetailComponent },
            { path: '/cart/:customerId', name: 'Cart', component: cart_item_list_component_1.ItemCartComponent }
        ]), 
        __metadata('design:paramtypes', [auth_service_1.AuthService])
    ], AppComponent);
    return AppComponent;
}());
exports.AppComponent = AppComponent;
github videogular / videogular2 / examples / build / app.js View on Github external
}
    VgDemo.prototype.ngOnInit = function () {
        var _this = this;
        this.router.subscribe(function () {
            _this.activeView = _this.location.path();
        });
    };
    VgDemo = __decorate([
        core_1.Component({
            selector: 'vg-demo',
            templateUrl: 'src/app.html',
            styles: [
                "\n        :host {\n            display: block;\n            margin: 0 auto;\n            max-width: 1200px;\n            font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n        }\n\n        :host header {\n            padding: 10px 30px;\n            color: white;\n            background-color: #507EB3;\n            z-index: 1;\n            position: relative;\n        }\n\n        :host aside {\n            width: 250px;\n            height: 100%;\n            position: fixed;\n            top: 0;\n            padding-top: 100px;\n            color: white;\n            background-color: #507EB3;\n        }\n\n        :host aside nav {\n            width: 100%;\n            color: white;\n            background-color: #507EB3;\n        }\n\n        :host aside nav ul {\n            padding: 0;\n            list-style-type: none;\n        }\n\n        :host aside nav ul li a {\n            text-decoration: none;\n            color: #ffffff;\n            font-size: 1.2em;\n            width: calc(100% - 20px);\n            display: inline-block;\n            padding: 10px;\n        }\n\n        :host aside nav ul li a:hover {\n            color: #507EB3;\n            background-color: white;\n            text-decoration: none;\n        }\n\n        :host aside nav ul li a.router-link-active {\n            color: #507EB3;\n            background-color: white;\n            text-decoration: none;\n        }\n\n        :host section {\n            padding-left: 280px;\n            padding-right: 30px;\n            margin: auto;\n        }\n\n        :host section .router-container {\n            margin: 0 auto;\n        }\n        "
            ],
            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;
}());