小编dra*_*oko的帖子

让ng-repeat在AngularJS的$ interpolate服务中工作

我正在使用AngularJs-UI组件进行Bootstrap.我想将填充的模板插入到popover功能的一个数据元素中.这适用于所有不在ng-repeat内部的元素.如何让ng-repeat元素在插值模板中工作?

我在http://plnkr.co/edit/Cuku7qaUTL1lxRkafKzv有一个吸烟者它不工作,因为我不知道如何在plunker中获得Angular-UI-bootstrap.

<div data-popover="{{createHTML()}}">some content</div>
Run Code Online (Sandbox Code Playgroud)

我的本地范围具有createHTML()看起来像这样的功能.

angular.module('myApp', ['ngSanitize'])
  .controller("myController", function(myService){
    $scope.createHTML = function() {
      var thingy = { blah: "foobar", collection: [ "1", "2", "3" ] };
      return myService.html_for(thingy);
    }
  });
Run Code Online (Sandbox Code Playgroud)

服务是

angular.module('myApp')
  .service('myService', function($templateCache, $interpolate, $sanitize, $log) {
    "use strict";

    function html_for(thingy) {
      var template = $templateCache.get('thingyTemplate.html'),
        link = $interpolate(template),
        html = link(thingy),
        unsafe = $sanitize(html);
      return unsafe;
    }

    return {
      html_for: html_for
    }
  });
Run Code Online (Sandbox Code Playgroud)

模板:

<script type="text/ng-template" id="thingyTemplate.html">
  <div>
    <div><strong>Blah:</strong> {{blah}}</div>
    <div data-ng-repeat="foo in …
Run Code Online (Sandbox Code Playgroud)

javascript twitter-bootstrap angularjs

9
推荐指数
1
解决办法
6414
查看次数

使用PHPMailer发送unicode表情符号

我正在尝试通过PHPMailer(5.2)发送unicode表情符号,但我发送的电子邮件收到了奇怪的字符而不是emojis.我正在发送HTML电子邮件,其中我只是echo一个包含一些utf-8表情符号的字符串,并检查电子邮件源字符串似乎正确打印.例如:

echo "";
Run Code Online (Sandbox Code Playgroud)

生产:

=F0=9F=98=81
Run Code Online (Sandbox Code Playgroud)

在电子邮件源代码中(应该没问题).

php email unicode phpmailer emoji

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