Skip to content

Instantly share code, notes, and snippets.

View tkc's full-sized avatar
🏠
Working from home

Tkc tkc

🏠
Working from home
  • Japan
View GitHub Profile
@tkc
tkc / 0_reuse_code.js
Last active August 29, 2015 14:06
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@tkc
tkc / angular_post.md
Last active August 29, 2015 14:27
angular post
app.controller('ModalInstanceCtrl', function ($scope, $modalInstance, $http, guest) {

    $scope.item = guest;

    $scope.save = function () {

        var req = {
 method: 'POST',
@tkc
tkc / window.data
Created August 20, 2015 03:27
window.data
<SCRIPT language="JavaScript">
window.data = {
'user_id':<?php echo Auth::user()->id ?>,
'article_id':<?php echo $article->id ?>
}
</SCRIPT>
The username and password for both databases is homestead / secret.
@tkc
tkc / ng-init
Created September 4, 2015 17:26
ng-init='company_item_code="{{$item->company_item_code}}"'
@tkc
tkc / $scope.init
Last active September 5, 2015 23:50
// register controller in html
<div data-ng-controller="myCtrl" data-ng-init="init()"></div>
// in controller
$scope.init = function () {
// check if there is query in url
// and fire search in case its value is not empty
};
@tkc
tkc / js debug
Created September 6, 2015 01:34
debugger
$http.get(url).success(function(data){
$scope.data = data; // get row data
$scope.data.mydatefield = new Date($scope.data.mydatefield); // convert filed to date
});
sample code
http://stackoverflow.com/questions/30537886/error-ngmodeldatefmt-expected-2015-05-29t190616-693209z-to-be-a-date-a
.xx-dialog .modal-dialog {
width :90%;
min-width: 800px;
}
modalInstance = $modal.open({
templateUrl: 'templates/editxxx.html',
controller: EditXXCtrl,
windowClass: 'xx-dialog',
resolve: {
$scope.modalOpen = function (_id) {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'myModalContent.html',
controller: 'ModalInstanceCtrl',
size: 'lg',
resolve: {
_id: function () {
return _id;