小编Mar*_*sco的帖子

在Angular Material中,如何使md-sidenav始终打开

可见切换按钮并随时关闭它?

我做了几次尝试但都失败了.

我上传了今天的图片,但它没有切换,只是在较低的分辨率下.

知道怎么做吗?

在此输入图像描述

angular-material

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

将Array json放在mysql返回Array上

字段'cats'是来自Angular app的选择框,包含来自table cats的数据,id,name和module_id.

功能在Slim框架上添加项目..

function addItem($section) {

  $request = \Slim\Slim::getInstance()->request();
  $item = json_decode($request->getBody());

  $sql = "INSERT INTO " .$section. " (title, subtitle, slug, excerpt, originalDate, content, cats, published) VALUES (:title, :subtitle, :slug, :excerpt, :originalDate, :content, :cats, :published)";

  try {
      $db = getConnection();
      $stmt = $db->prepare($sql);

      $stmt->bindParam("title", $item->title);
      $stmt->bindParam("subtitle", $item->subtitle);
      $stmt->bindParam("slug", $item->slug);
      $stmt->bindParam("excerpt", $item->excerpt);
      $stmt->bindParam("originalDate", $item->originalDate);
      $stmt->bindParam("content", $item->content);
      $stmt->bindParam("cats", $item->cats);
      $stmt->bindParam("published", $item->published);

      $stmt->execute();
      $item->id = $db->lastInsertId();
      $db = null;

      print_r(json_encode($item));
  } 
  catch(PDOException $e) {
      echo '{"error":{"text":'. $e->getMessage() .'}}';
  }
}
Run Code Online (Sandbox Code Playgroud)

角度代码,用于选择框 …

php mysql arrays slim angularjs

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

使用AngularFire通过ID Firebase重新搜索项目

我正在尝试搜索带有id的项目,但是我收到了此消息.所有功能都正常工作.执行时我收到此错误:

使用Firebase中的数组索引存储数据可能会导致意外行为.有关 详细信息,请参阅 https://www.firebase.com/docs/web/guide/understanding-data.html#section-arrays-in-firebase.

我的工厂

.factory('TEST', function ($firebaseArray) {

    var ref = new Firebase('https://shark-firebase.firebaseio.com');

    return {
        all: function(section) {
            var data = $firebaseArray(ref.child(section));
            return data;
        },
        get: function(section, id) {
            var data = $firebaseArray(ref.child(section).child(id));
            return data;
        }
    };
});
Run Code Online (Sandbox Code Playgroud)

我一起试试:

        get: function(section, id) {
            var data = $firebaseArray(ref.child(section));
            return data.$getRecord(id);
        }
Run Code Online (Sandbox Code Playgroud)

和我的控制器:

如果是,$ stateParams.section ='posts'和$ stateParams.id ='0'.

$scope.loadItem = function(){
    $scope.item = TEST.get($stateParams.section, $stateParams.id);
};
Run Code Online (Sandbox Code Playgroud)

angularjs firebase angularfire

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

更改接下来的CSS元素

我想悬停在a.bio改变背景.pic为绿色.

我尝试了一些方法,但没有成功.

我不理解它的逻辑~ 以及如何使其工作.

.executivo .pic::after {
  background-color: #00845b;
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  opacity: 0;
  transition: .3s ease-in-out;
}
.equipe a.bio:hover ~ .pic::after {
  opacity: 0.35;
}
.executivo .pic {
  margin-bottom: 45px;
  position: relative;
}
.executivo .pic img {
  display: block;
}
Run Code Online (Sandbox Code Playgroud)
<div class="executivo">
  <div class="pic">
    <img src="<?php echo $pic; ?>" alt="<?php echo $nome; ?>" />
  </div>

  <div class="title">
    <h3><?php echo $nome; ?></h3>
  </div>

  <a class="bio" …
Run Code Online (Sandbox Code Playgroud)

html css css-selectors css3

-1
推荐指数
1
解决办法
164
查看次数