小编use*_*928的帖子

使用bower添加ui.bootstrap依赖项

我试图将ui.bootstrap依赖项添加到我的角项目中(我使用yeoman,bower).我这样做了:

  1. 哟角
  2. 凉亭安装angular-ui
  3. 然后我添加到我的index.html文件中:和
  4. 咕噜声

然后我将ui.bootstrap依赖项添加到我的app.js:

angular.module('angularuiprojectApp', [
  'ngCookies',
  'ngResource',
  'ngSanitize',
  'ngRoute', 'ui.bootstrap'])
Run Code Online (Sandbox Code Playgroud)

当我尝试访问Chrome上的index.html时出现此错误:

未捕获错误:[$ injector:modulerr]由于以下原因无法实例化angularuiprojectApp模块:错误:[$ injector:modulerr]由于以下原因无法实例化模块ui.bootstrap:错误:[$ injector:nomod]模块'ui.bootstrap'是无法使用!你要么...... 1)

我不知道我错在哪里,如果有人可以帮助我...谢谢.

angularjs angular-ui bower

42
推荐指数
1
解决办法
5万
查看次数

uib-tooltip:有条件地显示或隐藏工具提示

我想有条件地启用/禁用按钮上的工具提示.我这样做是为了测试禁用状态:

<button type="button" 
    uib-tooltip="test" tooltip-is-open="false">
</button>
Run Code Online (Sandbox Code Playgroud)

但工具提示显示.如何禁用工具提示?

谢谢

angularjs angular-ui-bootstrap

15
推荐指数
1
解决办法
2万
查看次数

Angularjs:根据区域设置的格式编号

我需要显示这个数字2387,15
我用angularjs做这个:

{{myNumber|number:2}}
Run Code Online (Sandbox Code Playgroud)

我得到2,387.15我不想在2和3之间昏迷(我是法国人).

有没有办法用angularjs设置语言环境?

谢谢

angularjs

7
推荐指数
1
解决办法
5502
查看次数

angularjs - $ rootScope.$ on多次调用

在一个控制器中我做:

$rootScope.$emit("newAction", {});
Run Code Online (Sandbox Code Playgroud)

在另一个控制器我做:

$rootScope.$on('newAction', function() {
          vm.newAction (...);
          vm.newAction (...);
          vm.newAction (...);
          vm.newAction (...);
          vm.newAction (...);
          vm.newAction (...);
      });
Run Code Online (Sandbox Code Playgroud)

我的问题是多次调用$ rootScope.$ on.我不知道为什么.

如果有人有提示......谢谢

angularjs

7
推荐指数
1
解决办法
5995
查看次数

按嵌套对象的一个​​属性对对象数组进行排序

我需要通过其一个对象属性的一个属性来比较对象数组.
我在做 :

List<Sell> collect = sells.stream()
        .sorted(Comparator.comparing(Sell::getClient.name, String::compareToIgnoreCase))
        .collect(Collectors.toList());
Run Code Online (Sandbox Code Playgroud)

这不是编译,没有人知道该怎么办?

谢谢.

java arrays

6
推荐指数
1
解决办法
2281
查看次数

Tomcat:使用数据库连接部署两个应用程序时出现HikariCP问题

我正在尝试在同一tomcat7实例上部署两个WAR文件(app1.war和app2.war)。我收到此错误:

Unable to register MBean [HikariDataSource (HikariPool-0)] with key
  'dataSource'; nested exception is javax.management.InstanceAlreadyExistsException:
  com.zaxxer.hikari:name=dataSource,type=HikariDataSource
Run Code Online (Sandbox Code Playgroud)

如果我只在tomcat上部署了一个应用程序,则不会出现此错误。有办法解决这个问题吗?

java tomcat7 hikaricp

6
推荐指数
2
解决办法
2333
查看次数

ngtable:对嵌套对象进行排序和筛选

我有一个使用ngTable显示在表上的对象列表.我的对象看起来像:

obj {label:string,
     nestObj{nestLabel:string
            }
    }
Run Code Online (Sandbox Code Playgroud)

在我的控制器中,我想允许对字段'label'和'nestObject.label'进行排序和过滤.我试过这个:

$scope.tableParams = new ngTableParams({
        page: 1,            // show first page
        count: 10,
        filter: {
            label='',
            nestObj.label=''
        },
        sorting: {
            label: 'asc',
            nestObj.label: 'asc'
        }
    }, {
        total: data.length, // length of data
        getData: function($defer, params) {
            // use build-in angular filter
            var filteredData = params.filter() ?
            $filter('filter')(data, params.filter()) :
            data;
            var orderedData = params.sorting() ?
                    $filter('orderBy')(filteredData, params.orderBy()) :
                    data;

            params.total(orderedData.length); // set total for recalc pagination
            $defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * …
Run Code Online (Sandbox Code Playgroud)

angularjs ngtable

5
推荐指数
1
解决办法
4726
查看次数

ui-select:在Bootstrap网格系统中设置宽度

我在自举网格中有一个带有ui-select的表单.我希望我的ui-select与它下面的输入一样宽.这是我的代码

<div class="col-md-12">
   <div class="col-md-6 form-group">
        <label class="col-md-4" style="text-align:right;">Pays</label>
        <div class="col-md-8">
            <ui-select ng-model="adresse.pays" theme="select2" ng-disabled="disabled" ame="pays">
                <ui-select-match placeholder="Sélectionnez un pays..." allow-clear>{{$select.selected.nom}}</ui-select-match>
                <ui-select-choices repeat="pays in payss | propsFilter: {nom : $select.search}">
                    <div ng-bind-html="pays.nom | highlight: $select.search"></div>
                </ui-select-choices>
            </ui-select>
        </div>
    </div>
    <div class="col-md-6">
        <label class="col-md-4" style="text-align:right;">Mail</label>
        <input type="text" class="col-md-3 input-sm"
            ng-model="adresse.mail">
    </div>
</div>
<div class="col-md-12">
    <div class="form-group col-md-6">
        <label class="col-md-4" style="text-align:right;">Code adresse client</label>
        <input type="text" class="col-md-8 input-sm"
            ng-model="adresse.codeAdresseClient" name="codeAdresse">
    </div>
    <div class="form-group col-md-6">
        <label class="col-md-4" style="text-align:right;">Interlocuteur</label>
        <input type="text" class="col-md-3 input-sm"
            ng-model="adresse.interlocuteur" name="interlocuteur"> …
Run Code Online (Sandbox Code Playgroud)

twitter-bootstrap-3 ui-select

5
推荐指数
1
解决办法
7605
查看次数

带有 OVH 的 Javax 邮件 api

是否可以通过 OVH 使用 javax 邮件?我可以使用 Yahoo mail 来完成此操作,但是当我尝试将其与 OVH 一起使用时,我收到此错误:

在 org.springframeworkjavax.mail.MessagingException:读取响应异常;嵌套异常是:java.net.SocketException:连接重置

连接属性是:

properties.put("mail.smtp.starttls.enable", "true");
properties.put("mail.smtp.host", host);
properties.put("mail.smtp.user", from);
properties.put("mail.smtp.password", pass);
properties.put("mail.smtp.port", "465");
properties.put("mail.smtp.auth", "true");
properties.put("mail.imap.ssl.enable", "true");
Run Code Online (Sandbox Code Playgroud)

如果有人能看出我错在哪里......

谢谢。

java jakarta-mail ovh

5
推荐指数
1
解决办法
2330
查看次数

Jave:带有 pdf 附件的电子邮件:没有 MIME 类型应用程序/pdf 的对象 DCH

我想用 javax mail 在电子邮件中发送 pdf 文件。
下面,baos是一个ByteArrayOutputStream。

byte []  data=   baos.toByteArray();
OutputStream output = new FileOutputStream(fileName);
output.write(data);     
output.close();
DataSource source = new FileDataSource(fileName);
attachBodyPart.setDataHandler(new DataHandler(source, "application/pdf"));
attachBodyPart.setFileName(fileName);
multipart.addBodyPart(attachBodyPart);
message.setContent(multipart, "text/html");
Transport transport = session.getTransport("smtp");
transport.connect(host, from, pass);
transport.sendMessage(message, message.getAllRecipients());
transport.close();
Run Code Online (Sandbox Code Playgroud)

当我尝试发送电子邮件时遇到此异常:

javax.mail.MessagingException:发送消息时发生 IOException;
嵌套异常是: javax.activation.UnsupportedDataTypeException:没有 MIME 类型 application/pdf 的对象 DCH

我不知道这里出了什么问题。
如果有人这样做...

提前致谢。

java email

5
推荐指数
1
解决办法
6228
查看次数