我正在使用的项目是使用Kendo UI在ASP.NET MVC中编写的。 我正致力于将Angular 4应用到项目中。我们已经在使用Kendo UI控件,所以我决定使用Kendo UI来获取Angular组件。
我遇到的问题是当前的bootstrap / kendo库似乎与Angular库的Kendo UI冲突。每当我尝试使用kendo-dropddownlist或任何其他控件(如datetimepicker)时,生成的控件的外观/行为与其应该如何做(as seen on kendo site)
<kendo-dropdownlist [data]="currencies"></kendo-dropdownlist>
主要区别在于:焦点关闭不关闭项目列表,活动/悬停样式看起来非常糟糕,动画看起来很糟糕(列表在向下滑动之前跳起来) 这只是我遇到的一些问题。
有没有人有任何想法为什么会发生这种情况或我如何确定原因? 有没有人真的尝试在ASP.NET MVC应用程序中为Angular实现Kendo UI?
System.config.js代码:
/**
* System configuration for Angular samples
* Adjust as necessary for your application needs.
*/
(function (global) {
System.config({
paths: {
// paths serve as alias
'npm:': '/node_modules/'
},
// map tells the System loader where to look for things
map: {
// our app is within the app folder
'app': '/src/app',
// angular bundles
'@angular/animations': 'npm:@angular/animations/bundles/animations.umd.js',
'@angular/animations/browser': 'npm:@angular/animations/bundles/animations-browser.umd.js',
'@angular/core': 'npm:@angular/core/bundles/core.umd.js',
'@angular/common': 'npm:@angular/common/bundles/common.umd.js',
'@angular/compiler': 'npm:@angular/compiler/bundles/compiler.umd.js',
'@angular/platform-browser': 'npm:@angular/platform-browser/bundles/platform-browser.umd.js',
'@angular/platform-browser-dynamic': 'npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js',
'@angular/platform-browser/animations': 'npm:@angular/platform-browser/bundles/platform-browser-animations.umd.js',
'@angular/http': 'npm:@angular/http/bundles/http.umd.js',
'@angular/router': 'npm:@angular/router/bundles/router.umd.js',
'@angular/forms': 'npm:@angular/forms/bundles/forms.umd.js',
'@ng-bootstrap/ng-bootstrap': 'npm:@ng-bootstrap/ng-bootstrap/bundles/ng-bootstrap.js',
// other libraries
'rxjs': 'npm:rxjs',
'angular-in-memory-web-api': 'npm:angular-in-memory-web-api/bundles/in-memory-web-api.umd.js',
'tslib': 'npm:tslib/tslib.js',
'@progress': 'npm:@progress',
'@telerik': 'npm:@telerik'
},
// packages tells the System loader how to load when no filename and/or no extension
packages: {
app: {
defaultExtension: 'js',
meta: {
'./*.js': {
loader: '/src/systemjs-angular-loader.js'
}
}
},
rxjs: {
defaultExtension: 'js'
},
// Kendo UI for Angular packages
'npm:@progress/kendo-angular-buttons': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-angular-inputs': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@telerik/kendo-inputs-common': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-angular-l10n': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@telerik/kendo-draggable': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-angular-intl': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-angular-resize-sensor': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-intl': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@telerik/kendo-intl': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@telerik/kendo-dropdowns-common': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-angular-dropdowns': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-angular-popup': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-popup-common': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-angular-dateinputs': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
'npm:@progress/kendo-date-math': {
main: './dist/npm/main.js',
defaultExtension: 'js'
},
}
});
})(this);
在我的布局页面中,我使用了剑道CDN&#39>
@Styles.Render("https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.dataviz.min.css")
@Styles.Render("https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.common-bootstrap.min.css")
@Styles.Render("https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.bootstrap.min.css")
@Styles.Render("https://kendo.cdn.telerik.com/2017.3.1026/styles/kendo.dataviz.bootstrap.min.css")
@Styles.Render("https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css")
@Scripts.Render("https://kendo.cdn.telerik.com/2017.3.1026/js/jquery.min.js")
@Scripts.Render("https://kendo.cdn.telerik.com/2017.3.1026/js/kendo.all.min.js")
@Scripts.Render("https://kendo.cdn.telerik.com/2017.3.1026/js/kendo.aspnetmvc.min.js")
的package.json
{
"version": "1.0.0",
"name": "asp.net",
"private": true,
"scripts": {
"build": "tsc -p src/",
"build:watch": "tsc -p src/ -w",
"build:e2e": "tsc -p e2e/",
"serve": "lite-server -c=bs-config.json",
"serve:e2e": "lite-server -c=bs-config.e2e.json",
"prestart": "npm run build",
"start": "concurrently \"npm run build:watch\" \"npm run serve\"",
"pree2e": "npm run build:e2e",
"e2e": "concurrently \"npm run serve:e2e\" \"npm run protractor\" --kill-others --success first",
"preprotractor": "webdriver-manager update",
"protractor": "protractor protractor.config.js",
"pretest": "npm run build",
"test": "concurrently \"npm run build:watch\" \"karma start karma.conf.js\"",
"pretest:once": "npm run build",
"test:once": "karma start karma.conf.js --single-run",
"lint": "tslint ./src/**/*.ts -t verbose"
},
"dependencies": {
"@angular/animations": "^4.4.6",
"@angular/common": "~4.4.6",
"@angular/compiler": "~4.4.6",
"@angular/core": "~4.4.6",
"@angular/forms": "^4.4.6",
"@angular/http": "~4.4.6",
"@angular/platform-browser": "~4.4.6",
"@angular/platform-browser-dynamic": "~4.4.6",
"@angular/router": "~4.4.6",
"@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.6",
"@progress/kendo-angular-buttons": "^2.0.0",
"@progress/kendo-angular-dateinputs": "^1.4.3",
"@progress/kendo-angular-dropdowns": "^1.6.0",
"@progress/kendo-angular-inputs": "^1.4.2",
"@progress/kendo-angular-intl": "^1.3.0",
"@progress/kendo-angular-l10n": "^1.0.5",
"@progress/kendo-theme-bootstrap": "^2.9.3",
"@progress/kendo-theme-default": "^2.47.0",
"angular-in-memory-web-api": "~0.5.1",
"bootstrap": "^4.0.0-beta.2",
"bootstrap-css-only": "4.0.0-beta.2",
"core-js": "^2.4.1",
"jquery": "^3.2.1",
"popper.js": "^1.12.3",
"reflect-metadata": "^0.1.10",
"rxjs": "5.5.3",
"systemjs": "0.20.19",
"web-animations-js": "^2.3.1",
"zone.js": "^0.8.18"
},
"devDependencies": {
"@types/jasmine": "2.8.2",
"@types/jquery": "^3.2.16",
"@types/node": "^8.0.54",
"canonical-path": "0.0.2",
"concurrently": "^3.2.0",
"jasmine-core": "~2.8.0",
"karma": "^1.3.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-jasmine-html-reporter": "^0.2.2",
"lite-server": "^2.2.2",
"lodash": "^4.16.4",
"protractor": "~5.2.0",
"rimraf": "^2.5.4",
"tslint": "^5.8.0",
"typescript": "~2.6.2"
}
}