GithubHelp home page GithubHelp logo

michalsn / codeigniter-angularjs-app Goto Github PK

View Code? Open in Web Editor NEW
129.0 26.0 120.0 118 KB

Sample App based on CodeIgniter and AngularJS

PHP 97.35% JavaScript 2.53% ApacheConf 0.12%
codeigniter angularjs codeigniter-angularjs

codeigniter-angularjs-app's Introduction

CodeIgniter AngularJS App

Sample App based on CodeIgniter 3.x and AngularJS 1.x.

This is very simple example - CRUD.

How to start?

  • Set database config in appliaction/config/database.php
  • Autoload database and url in application/config/autoload.php
  • Import database.sql file to your database
  • Adjust .htaccess file to your needs

You're ready to go - http://localhost/your_project/projects

codeigniter-angularjs-app's People

Contributors

marcelod avatar michalsn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

codeigniter-angularjs-app's Issues

Code is not Working for me

hey first of all i want to say thanks to you.
Actually i am newbie for AngularJS. I want to integrated it into my CI project. So when i search on Google i found your code. Now i am trying to run the code but its not running. So if you explain the process of install and run your code its very help full for me.
thank you

Getting more done in GitHub with ZenHub

Hola! @drtuts has created a ZenHub account for the michalsn organization. ZenHub is the only project management tool integrated natively in GitHub – created specifically for fast-moving, software-driven teams.


How do I use ZenHub?

To get set up with ZenHub, all you have to do is download the browser extension and log in with your GitHub account. Once you do, you’ll get access to ZenHub’s complete feature-set immediately.

What can ZenHub do?

ZenHub adds a series of enhancements directly inside the GitHub UI:

  • Real-time, customizable task boards for GitHub issues;
  • Multi-Repository burndown charts, estimates, and velocity tracking based on GitHub Milestones;
  • Personal to-do lists and task prioritization;
  • Time-saving shortcuts – like a quick repo switcher, a “Move issue” button, and much more.

Add ZenHub to GitHub

Still curious? See more ZenHub features or read user reviews. This issue was written by your friendly ZenHub bot, posted by request from @drtuts.

ZenHub Board

How to try it

hi michalsn,
I have adding database.php, autoload.php and config.php and set it up, and try to run it in server but it doesn't work.

Any help?

Thanks

REST_Controller trying to find save_get instead of save_post

Q: is there some configuration parameter I've hosed up to make
REST_Controller::_detect_method return 'GET' instead of 'POST' ?
The first line in _detect_method is:
$method = strtolower($this->input->server('REQUEST_METHOD'));
and it does return 'GET' instead of the expected 'POST'.

The two example projects are stored in database ok and show up in the initial list. "Edit" buttons works fine, but "SAVE" button gets internal server error 500 because REST_Controller is fishing around for "save_get" instead of "save_post" method.

console log shows:
POST http://localhost/cia3/api/projects/save/2 500 (Internal Server Error)

so save/2 is being sent as POST. But REST_Controller returns:

{"status":false,"error":"Unknown method [save_get]."}

script.js has the usual:
...
angular.module('projectApi', ['ngResource']).
factory('Project', function($resource) {
var Project = $resource(BASE_URL+'api/projects/:method/:id', {}, {
query: {method:'GET', params: {method:'index'}, isArray:true },
save: {method:'POST', params: {method:'save'} },
get: {method:'GET', params: {method:'edit'} },
remove: {method:'DELETE', params: {method:'remove'} }
});

Project.prototype.update = function(cb) {
console.log('angular.module Project.prototype.update function cb: ' + cb);
  return Project.save({id: this.id},
      angular.extend({}, this, {id:undefined}), cb);
};

...

Edit controller on $scope.project returning $promise in the object

app.controller('EditCtrl',['$scope','$routeParams','$location','Project',function($scope,$routeParams,$location,Project){
var self = this;
Project.get({id: $routeParams.id}, function(project) {
console.log(project)
self.original = project;
$scope.project = new Project(self.original);

});

$scope.isClean = function() {
return angular.equals(self.original, $scope.project);
};

$scope.destroy = function() {
self.original.destroy(function() {
$location.path('/');
});
};

$scope.save = function() {
$scope.project.update(function() {
$location.path('/');
});
};
}]);

When i console.log(project) here is the output in the console :
{id: "6", name: "asd", site: "http://google.com", description: "asd", $promise: d…}$promise: d$$state: Object__proto__: Object$resolved: truedescription: "asd"id: "6"name: "asd"site: "http://google.com"

So when trying to update the database error occured, trying to update $promise column

How can i fix this problem ?
Thanks

Listing showing blank

Hi @michalsn , I am new to AngularJS and having experience in CI. I tried your project and listing is empty. I can see table titles, add, edit, delete buttons. Could you please help me
ci_ang_sample

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.