我有一些自定义的js文件,我在angular-cli.json文件中导入了所有这些文件。问题是,在从一个页面路由到另一个页面之后页面没有刷新页面时看不到它们。
angular-cli.json文件:
"styles": [
"styles.css",
"./assets/plugins/bootstrap/css/bootstrap.css",
"./assets/plugins/node-waves/waves.css",
"./assets/plugins/animate-css/animate.css",
"./assets/plugins/morrisjs/morris.css",
"./assets/plugins/jquery-datatable/skin/bootstrap/css/dataTables.bootstrap.css",
"./assets/css/style.css",
"./assets/css/themes/all-themes.css"
],
"scripts": [
"./assets/plugins/jquery/jquery.min.js",
"./assets/plugins/bootstrap/js/bootstrap.js",
"./assets/plugins/bootstrap-select/js/bootstrap-select.js",
"./assets/plugins/jquery-slimscroll/jquery.slimscroll.js",
"./assets/plugins/node-waves/waves.js",
"./assets/plugins/jquery-countto/jquery.countTo.js",
"./assets/plugins/raphael/raphael.min.js",
"./assets/plugins/morrisjs/morris.js",
"./assets/plugins/chartjs/Chart.bundle.js",
"./assets/plugins/flot-charts/jquery.flot.js",
"./assets/plugins/flot-charts/jquery.flot.resize.js",
"./assets/plugins/flot-charts/jquery.flot.pie.js",
"./assets/plugins/flot-charts/jquery.flot.categories.js",
"./assets/plugins/flot-charts/jquery.flot.time.js",
"./assets/plugins/jquery-sparkline/jquery.sparkline.js",
"./assets/plugins/jquery/jquery.min.js",
"./assets/plugins/bootstrap/js/bootstrap.js",
"./assets/plugins/node-waves/waves.js",
"./assets/plugins/jquery-validation/jquery.validate.js",
"./assets/plugins/jquery-datatable/jquery.dataTables.js",
"./assets/plugins/jquery-datatable/skin/bootstrap/js/dataTables.bootstrap.js",
"./assets/plugins/jquery-datatable/extensions/export/dataTables.buttons.min.js",
"./assets/plugins/jquery-datatable/extensions/export/buttons.flash.min.js",
"./assets/plugins/jquery-datatable/extensions/export/jszip.min.js",
"./assets/plugins/jquery-datatable/extensions/export/pdfmake.min.js",
"./assets/plugins/jquery-datatable/extensions/export/vfs_fonts.js",
"./assets/plugins/jquery-datatable/extensions/export/buttons.html5.min.js",
"./assets/plugins/jquery-datatable/extensions/export/buttons.print.min.js",
"./assets/js/admin.js",
"./assets/js/pages/tables/jquery-datatable.js",
"./assets/js/pages/examples/sign-in.js",
"./assets/js/pages/index.js",
"./assets/js/demo.js"
]
app.module.ts:
RouterModule.forRoot([
{
path: 'Main', component: MainComponent, canActivate: [], children: [
{ path: '', component: HomeComponent },
{ path: 'Users', component: UsersComponent },
]
},
{ path: 'Login', component: LoginComponent },
{ path: '**', redirectTo: 'Login' }
])
答案 0 :(得分:0)
你确定使用ngOnit触发它们吗?