Skip to content

Instantly share code, notes, and snippets.

Tkc tkc

  • Japan
Block or report user

Report or block tkc

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tkc
tkc / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// 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 Aug 29, 2015
angular post
View angular_post.md
app.controller('ModalInstanceCtrl', function ($scope, $modalInstance, $http, guest) {

    $scope.item = guest;

    $scope.save = function () {

        var req = {
            method: 'POST',
@tkc
tkc / window.data
Created Aug 20, 2015
window.data
View window.data
<SCRIPT language="JavaScript">
window.data = {
'user_id':<?php echo Auth::user()->id ?>,
'article_id':<?php echo $article->id ?>
}
</SCRIPT>
View gist:3af2c208a5c16ad2aee0
The username and password for both databases is homestead / secret.
View ng-init
ng-init='company_item_code="{{$item->company_item_code}}"'
View $scope.init
// 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
};
View new Date($scope.data.mydatefield)
$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
View modal size
.xx-dialog .modal-dialog {
width :90%;
min-width: 800px;
}
modalInstance = $modal.open({
templateUrl: 'templates/editxxx.html',
controller: EditXXCtrl,
windowClass: 'xx-dialog',
resolve: {
View anguler modal resolve sample
$scope.modalOpen = function (_id) {
var modalInstance = $modal.open({
animation: true,
templateUrl: 'myModalContent.html',
controller: 'ModalInstanceCtrl',
size: 'lg',
resolve: {
_id: function () {
return _id;
You can’t perform that action at this time.