Skip to content

Commit

Permalink
fixed case for component name
Browse files Browse the repository at this point in the history
  • Loading branch information
turtle220 committed Mar 6, 2016
1 parent 8b382b5 commit 597fe82
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/Console/Commands/AngularComponent.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,13 @@ public function handle()
{
$name = $this->argument('name');
$studly_name = studly_case($name);
$component_name = strtolower(substr($studly_name, 0, 1)).substr($studly_name, 1);

$html = file_get_contents(__DIR__.'/Stubs/AngularComponent/component.html.stub');
$js = file_get_contents(__DIR__.'/Stubs/AngularComponent/component.js.stub');
$less = file_get_contents(__DIR__.'/Stubs/AngularComponent/component.less.stub');

$js = str_replace('{{StudlyName}}', $studly_name, $js);
$js = str_replace('{{name}}', $name, $js);
$js = str_replace('{{componentName}}', $component_name, $js);

$folder = base_path(config('generators.source.root')).'/'.config('generators.source.components').'/'.$name;
if (is_dir($folder)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class {{StudlyName}}Controller{
}
}

export const {{componentName}}Component = {
export const {{StudlyName}}Component = {
templateUrl: './views/app/components/{{name}}/{{name}}.component.html',
controller: {{StudlyName}}Controller,
controllerAs: 'vm',
Expand Down

0 comments on commit 597fe82

Please sign in to comment.