1

我正在用 meanjs 堆栈构建一个项目。我想使用一个我发现的角度库来使我的选择器看起来像引导程序提供给我们的那些。

https://github.com/joaoneto/angular-bootstrap-select(这是库)

我将它添加到我的 bower.json 中,它已正确安装在我的 public/lib 文件夹中。之后,我将它与 bootstrap-select.js 一起包含在我的配置中。

/rootFolder/config/env/all.js:

'use strict';

module.exports = {
    app: {
        title: 'MyProject',
        description: 'my project description',
        keywords: 'MongoDB, Express, AngularJS, Node.js'
    },
    port: process.env.PORT || 3000,
    templateEngine: 'swig',
    sessionSecret: 'MEAN',
    sessionCollection: 'sessions',
    assets: {
        lib: {
            css: [
                'public/lib/bootstrap/dist/css/bootstrap.css',
                'public/lib/bootstrap/dist/css/bootstrap-theme.css',
            ],
            js: [
                'public/lib/angular/angular.js',
                'public/lib/angular-resource/angular-resource.js', 
                'public/lib/angular-cookies/angular-cookies.js', 
                'public/lib/angular-animate/angular-animate.js', 
                'public/lib/angular-touch/angular-touch.js', 
                'public/lib/angular-sanitize/angular-sanitize.js', 
                'public/lib/angular-ui-router/release/angular-ui-router.js',
                'public/lib/angular-ui-utils/ui-utils.js',
                'public/lib/angular-bootstrap/ui-bootstrap-tpls.js',
                'public/lib/bootstrap-select/bootstrap-select.js',
                'public/lib/angular-bootstrap-select/build/angular-bootstrap-select.js'
            ]
        },
        css: [
            'public/modules/**/css/*.css',
            'public/dist/css/*.css'
        ],
        js: [
            'public/config.js',
            'public/application.js',
            'public/modules/*/*.js',
            'public/modules/*/*[!tests]*/*.js'
        ],
        tests: [
            'public/lib/angular-mocks/angular-mocks.js',
            'public/modules/*/tests/*.js'
        ]
    }
};

我收到以下错误:Uncaught TypeError: Cannot read property 'expr' of undefined

我进入了库,我在这里得到了错误:

$.expr[':'].icontains = function(obj, index, meta) {
    return $(obj).text().toUpperCase().indexOf(meta[3].toUpperCase()) >= 0;
};

任何帮助将不胜感激,谢谢!

4

0 回答 0