小编Raj*_*iya的帖子

在Angular js中调用$ sce.trustAsHtml()字符串中的函数

我正在使用Angularjs开发一个应用程序并在我的页面中添加HTML使用$sce.trustAsHtml().我想在上面动态添加内容中调用一个函数.我的html和脚本如下.

HTML

<div ng-app="ngBindHtmlExample">
  <div ng-controller="ngBindHtmlCtrl">
   <p ng-bind-html="myHTML"></p>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

使用Javascript

angular.module('ngBindHtmlExample', ['ngSanitize'])

.controller('ngBindHtmlCtrl', ['$scope','$sce', function ngBindHtmlCtrl($scope, $sce) {
  $scope.myHTML =$sce.trustAsHtml(
     'I am an <code>HTML</code>string with <a href="#" ng-mouseover="removeExp()">links!</a> and other <em>stuff</em>');

    $scope.removeExp = function (){
       console.log('dfdfgdfgdfg');
    }
}]);
Run Code Online (Sandbox Code Playgroud)

的jsfiddle

点击这里查看

javascript angularjs

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

jQuery UI Datepicker月份和年份组合在jQuery BlockUI中不起作用(Popup)

当我在BlockUI(弹出窗口)中打开jQuery UI datepicker并尝试更改月份和年份时,下拉列表无法打开.它在弹出窗口工作正常,但在datepicker的一边.

HTML:

<div class="popup">
    Date Picker<input type="text" class="datepicker" />
</div>
Run Code Online (Sandbox Code Playgroud)

jQuery的:

$(document).ready(function(e) {
    $.blockUI({
        message:$('.popup'),
        focusInput: false,
        onBlock:function(){}
    });

    $( ".datepicker" ).datepicker({
        dateFormat: 'dd-mm-yy',
        changeYear: true,
        changeMonth: true,
        yearRange: 'c-10:c+3',
        showButtonPanel: false            
    }); 
});
Run Code Online (Sandbox Code Playgroud)

的jsfiddle

jquery jquery-ui

8
推荐指数
1
解决办法
6854
查看次数

React-native-video 在我的应用程序中显示空白屏幕,没有任何错误日志

我正在使用react-native-cli,在我的应用程序中,react-native-video 在我的页面中不起作用。它显示空白区域。我已经运行react-native link命令来链接库,并且在运行react-native run-android命令后但显示空白,没有任何错误。我正在使用react-native v 0.48.4 任何帮助表示赞赏!

import React, { Component } from 'react';
import { StyleSheet, Text, View, ScrollView,Image, Dimensions,Alert } from 'react-native';
import Video from 'react-native-video';


export default class HomeScreen extends Component {
  constructor(props) {
    super(props);

    this.loadStart = this.loadStart.bind(this);
    this.onLoad = this.onLoad.bind(this);
    this.onProgress = this.onProgress.bind(this);
    this.onEnd = this.onEnd.bind(this);
    this.onError = this.onError.bind(this);
    this.onBuffer = this.onBuffer.bind(this);
    this.onTimedMetadata = this.onTimedMetadata.bind(this);
  };

  loadStart(){
    console.log('loadStart');
  }
  onLoad(){
    console.log('onLoad');
  }

  onProgress(){
    console.log('onProgress');
  }

  onEnd(){
    console.log('onEnd');
  }

  onError(){
    console.log('onError'); …
Run Code Online (Sandbox Code Playgroud)

react-native react-native-cli

4
推荐指数
1
解决办法
8423
查看次数

与Google Chrome相比,iscroll鼠标滚轮在Firefox中运行缓慢

请查看此示例链接: http ://lab.cubiq.org/iscroll5/demos/probe/

如果我在chrome中运行上面的示例页面并滚动鼠标滚轮,则页面每次都会上升100px.你可以看到有Y位置打印.如果我在firefox 26.0中运行相同的页面并滚动鼠标滚轮,则每次页面上升3px.你可以看到firefox中的页面速度非常慢.有没有办法解决它们?

javascript jquery iscroll

3
推荐指数
1
解决办法
3832
查看次数