所以,我是AngularJS的新手,我试图在点击另一个之后更改div内容(这个包含一个div,其中包含我想要放在第一个上面的内容).
HTML
<div ng-controller="dCtrl">
<ul ng-repeat="product in products">
<li change>
{{product.name}}
<div class="hide">{{product.description}}</div>
</li>
</ul>
</div>
<div id="test"></div>
Run Code Online (Sandbox Code Playgroud)
使用Javascript
var app = angular.module("dt", []);
app.directive("change", function() {
return function(scope, element) {
element.bind("click", function() {
var message = element.children("div").text();
console.log("breakpoint");
angular.bind("#test", function() {
this.text(message);
});
})
}
})
app.controller("dCtrl", function($scope) {
$scope.products = [
{ "name" : "Escova XPTO", "description": "Lava tudo num instante"},
{ "name" : "Pasta de Dentes YMZ", "description": "Dentifrico do camandro"}
];
})
Run Code Online (Sandbox Code Playgroud)
我知道我可以说:
$("#test").html(message);
Run Code Online (Sandbox Code Playgroud)
但我仍然对混合jQuery和AngularJS感到困惑,我不知道这是否是一种正确的方法
谢谢
我正在尝试部署应用程序,但收到错误。以下研究指出了我这里:
warning in tree f148931b374ad1aa9748b8f91bd48fcb44fb73b0: nullSha1: contains entries pointing to null sha1
Checking object directories: 100% (256/256), done.
broken link from tree f148931b374ad1aa9748b8f91bd48fcb44fb73b0
to blob 0000000000000000000000000000000000000000
missing blob 0000000000000000000000000000000000000000
Run Code Online (Sandbox Code Playgroud)
尝试了这里的解决方案,但命令在终端上没有执行任何操作,它们只是坐在那里。
有人可以帮助我吗?
我第一次在 Laravel 中使用 session 并且我正在尝试做一个多步骤的表单,所以我认为使用 session 将是一个聪明的举动。但是下面的代码返回一个空值,我做错了什么?
$user_information = [
"name" => $request->name,
"email" => $request->email,
"remember_token" => $request->_token,
"password" => bcrypt($request->password),
"role_id" => 3
];
session('user_signup', $user_information);
dd(session('user_signup'));
Run Code Online (Sandbox Code Playgroud) 我无法获取客户端的 IP 地址,我需要确定他的当前位置。
我使用过 request->ip(), $_SERVER['REMOTE_ADDR'] 并且我总是得到 127.0.0.1 结果,这不是我想要的。
我究竟做错了什么?